aboutsummaryrefslogtreecommitdiff
path: root/monsterwm.c
diff options
context:
space:
mode:
authorIvan Kanakarakis <ivan.kanak@gmail.com>2012-03-01 19:28:00 +0200
committerIvan Kanakarakis <ivan.kanak@gmail.com>2012-12-16 02:11:13 +0200
commit56c613830041d6902d97ac93f8bb7eb704d95039 (patch)
treead2740a13a27e2f2881c9501db4f817c319a0fdc /monsterwm.c
parent91d40f6c978c94e61b3b8b4b1af2954edd68001e (diff)
focus urgent window with a shortcut
Diffstat (limited to 'monsterwm.c')
-rw-r--r--monsterwm.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/monsterwm.c b/monsterwm.c
index bb1795e..00027af 100644
--- a/monsterwm.c
+++ b/monsterwm.c
@@ -80,6 +80,7 @@ typedef struct {
/* exposed function prototypes sorted alphabetically */
static void change_desktop(const Arg *arg);
static void client_to_desktop(const Arg *arg);
+static void focusurgent();
static void killclient();
static void last_desktop();
static void move_down();
@@ -564,6 +565,15 @@ void focusin(XEvent *e) {
}
/**
+ * find and focus the first client which received
+ * an urgent hint in the current desktop
+ */
+void focusurgent(void) {
+ Desktop *d = &desktops[currdeskidx];
+ for (Client *c = d->head; c; c = c->next) if (c->isurgn) focus(c, d);
+}
+
+/**
* get a pixel with the requested color to
* fill some window area (such as borders)
*/