summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQC <qball@gmpclient.org>2015-04-03 18:01:03 +0200
committerQC <qball@gmpclient.org>2015-04-03 18:01:03 +0200
commit957ffe5fcf4267c8d38d77e55da720b642757901 (patch)
tree34c4e90fe84589f37278d5eafce61f518f2529b6
parent0ab7aa4bbac021bab76be59dde83cf0a516d4e08 (diff)
Check WMHints for urgent hint
-rw-r--r--source/dialogs/window.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source/dialogs/window.c b/source/dialogs/window.c
index 4c8d8057..729170c7 100644
--- a/source/dialogs/window.c
+++ b/source/dialogs/window.c
@@ -47,7 +47,7 @@
#define CLIENTTITLE 100
#define CLIENTCLASS 50
#define CLIENTNAME 50
-#define CLIENTSTATE 20
+#define CLIENTSTATE 10
#define CLIENTROLE 50
// a manageable window
@@ -64,6 +64,7 @@ typedef struct
workarea monitor;
int active;
int demands;
+ long hint_flags;
} client;
// TODO
extern Display *display;
@@ -274,6 +275,12 @@ static client* window_client ( Display *display, Window win )
XFree ( chint.res_name );
}
+ XWMHints *wh;
+ if ( ( wh = XGetWMHints ( display, c->window ) ) != NULL ) {
+ c->hint_flags = wh->flags;
+ XFree ( wh );
+ }
+
monitor_dimensions ( display, c->xattr.screen, c->xattr.x, c->xattr.y, &c->monitor );
winlist_append ( cache_client, c->window, c );
return c;
@@ -401,6 +408,9 @@ static char ** window_mode_get_data ( unsigned int *length, Switcher *sw )
if ( client_has_state ( c, netatoms[_NET_WM_STATE_DEMANDS_ATTENTION] ) ) {
c->demands = TRUE;
}
+ if ( ( c->hint_flags & XUrgencyHint ) == XUrgencyHint ) {
+ c->demands = TRUE;
+ }
if ( c->window == curr_win_id ) {
c->active = TRUE;