Permalink
Browse files

focus urgent window with a shortcut

  • Loading branch information...
1 parent a67438a commit 92664840e9f4bda4f4182382172d61c34e560f87 @c00kiemon5ter committed Mar 1, 2012
Showing with 11 additions and 0 deletions.
  1. +1 −0 config.def.h
  2. +10 −0 monsterwm.c
View
1 config.def.h
@@ -65,6 +65,7 @@ static const char *menucmd[] = { "dmenu_run", NULL };
static Key keys[] = {
/* modifier key function argument */
{ MOD1, XK_b, togglepanel, {NULL}},
+ { MOD1, XK_BackSpace, focusurgent, {NULL}},
{ MOD1|SHIFT, XK_c, killclient, {NULL}},
{ MOD1, XK_j, next_win, {NULL}},
{ MOD1, XK_k, prev_win, {NULL}},
View
10 monsterwm.c
@@ -83,6 +83,7 @@ static void change_desktop(const Arg *arg);
static void change_monitor(const Arg *arg);
static void client_to_desktop(const Arg *arg);
static void client_to_monitor(const Arg *arg);
+static void focusurgent();
static void killclient();
static void last_desktop();
static void move_down();
@@ -646,6 +647,15 @@ void focusin(XEvent *e) {
}
/**
+ * find and focus the first client which received
+ * an urgent hint in the current desktop in the current monitor
+ */
+void focusurgent(void) {
+ Desktop *d = &monitors[currmonidx].desktops[monitors[currmonidx].currdeskidx];
+ for (Client *c = d->head; c; c = c->next) if (c->isurgn) focus(c, d, &monitors[currmonidx]);
+}
+
+/**
* get a pixel with the requested color to
* fill some window area (such as borders)
*/

0 comments on commit 9266484

Please sign in to comment.