turn on demands_attention when urgent gets set, and turn it off when urgent is removed, for those apps that think it is 1917 or something

This commit is contained in:
Dana Jansens 2007-05-02 23:03:43 +00:00
parent 1d9c0e8b87
commit 80117db6c4
2 changed files with 19 additions and 5 deletions

View file

@ -1622,6 +1622,8 @@ void client_update_wmhints(ObClient *self)
self->can_focus = TRUE; self->can_focus = TRUE;
if ((hints = XGetWMHints(ob_display, self->window)) != NULL) { if ((hints = XGetWMHints(ob_display, self->window)) != NULL) {
gboolean ur;
if (hints->flags & InputHint) if (hints->flags & InputHint)
self->can_focus = hints->input; self->can_focus = hints->input;
@ -1631,6 +1633,13 @@ void client_update_wmhints(ObClient *self)
if (hints->flags & StateHint) if (hints->flags & StateHint)
self->iconic = hints->initial_state == IconicState; 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)) if (!(hints->flags & WindowGroupHint))
hints->window_group = None; hints->window_group = None;
@ -2775,12 +2784,14 @@ void client_hilite(ObClient *self, gboolean hilite)
/* don't allow focused windows to hilite */ /* don't allow focused windows to hilite */
self->demands_attention = hilite && !client_focused(self); self->demands_attention = hilite && !client_focused(self);
if (self->frame != NULL) { /* if we're mapping, just set the state */
if (self->demands_attention) if (self->demands_attention)
frame_flash_start(self->frame); frame_flash_start(self->frame);
else else
frame_flash_stop(self->frame); frame_flash_stop(self->frame);
client_change_state(self); client_change_state(self);
} }
}
void client_set_desktop_recursive(ObClient *self, void client_set_desktop_recursive(ObClient *self,
guint target, gboolean donthide) guint target, gboolean donthide)

View file

@ -258,6 +258,9 @@ struct _ObClient
/*! Demands attention flag */ /*! Demands attention flag */
gboolean demands_attention; gboolean demands_attention;
/*! The urgent flag */
gboolean urgent;
/*! The layer in which the window will be stacked, windows in lower layers /*! The layer in which the window will be stacked, windows in lower layers
are always below windows in higher layers. */ are always below windows in higher layers. */
ObStackingLayer layer; ObStackingLayer layer;