]> Dogcows Code - chaz/openbox/commitdiff
turn on demands_attention when urgent gets set, and turn it off when urgent is remove...
authorDana Jansens <danakj@orodu.net>
Wed, 2 May 2007 23:03:43 +0000 (23:03 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 2 May 2007 23:03:43 +0000 (23:03 +0000)
openbox/client.c
openbox/client.h

index 5e1a78513992929a178fb871bfbffa0b89a1b3b2..27470d34d5e4128a4ae9fcb052b4ac1dcac5e433 100644 (file)
@@ -1622,6 +1622,8 @@ void client_update_wmhints(ObClient *self)
     self->can_focus = TRUE;
   
     if ((hints = XGetWMHints(ob_display, self->window)) != NULL) {
+        gboolean ur;
+
         if (hints->flags & InputHint)
             self->can_focus = hints->input;
 
@@ -1631,6 +1633,13 @@ void client_update_wmhints(ObClient *self)
             if (hints->flags & StateHint)
                 self->iconic = hints->initial_state == IconicState;
 
+        ur = self->urgent;
+        self->urgent = (hints->flags & XUrgencyHint);
+        if (self->urgent && !ur)
+            client_hilite(self, TRUE);
+        else if (!self->urgent && ur && self->demands_attention)
+            client_hilite(self, FALSE);
+
         if (!(hints->flags & WindowGroupHint))
             hints->window_group = None;
 
@@ -2775,11 +2784,13 @@ void client_hilite(ObClient *self, gboolean hilite)
 
     /* don't allow focused windows to hilite */
     self->demands_attention = hilite && !client_focused(self);
-    if (self->demands_attention)
-        frame_flash_start(self->frame);
-    else
-        frame_flash_stop(self->frame);
-    client_change_state(self);
+    if (self->frame != NULL) { /* if we're mapping, just set the state */
+        if (self->demands_attention)
+            frame_flash_start(self->frame);
+        else
+            frame_flash_stop(self->frame);
+        client_change_state(self);
+    }
 }
 
 void client_set_desktop_recursive(ObClient *self,
index 5847c67f6cfd7b98fa8e88019e9c904bd69caa00..f75d155cb9930ae19efbf9cd4a38a1664e1fecac 100644 (file)
@@ -258,6 +258,9 @@ struct _ObClient
     /*! Demands attention flag */
     gboolean demands_attention;
 
+    /*! The urgent flag */
+    gboolean urgent;
+
     /*! The layer in which the window will be stacked, windows in lower layers
       are always below windows in higher layers. */
     ObStackingLayer layer;
This page took 0.027152 seconds and 4 git commands to generate.