diff --git a/src/client.c b/src/client.c index 4baa1220b179498020d711d8cded419f51da96b3..b075ade589101a15099506015828f936cf88280c 100644 --- a/src/client.c +++ b/src/client.c @@ -345,13 +345,25 @@ urgent_cb (gpointer data) { Client *c; - TRACE ("entering urgent_cb"); + TRACE ("entering urgent_cb, iteration %i", c->blink_iterations); c = (Client *) data; if (c != clientGetFocus ()) { - FLAG_TOGGLE (c->xfwm_flags, XFWM_FLAG_SEEN_ACTIVE); - frameQueueDraw (c, FALSE); + c->blink_iterations++; + if (c->blink_iterations < (2 * MAX_BLINK_ITERATIONS + 1)) + { + FLAG_TOGGLE (c->xfwm_flags, XFWM_FLAG_SEEN_ACTIVE); + frameQueueDraw (c, FALSE); + } + else if (c->blink_iterations > (8 * MAX_BLINK_ITERATIONS)) + { + c->blink_iterations = 0; + } + } + else if (c->blink_iterations) + { + c->blink_iterations = 0; } return (TRUE); } @@ -372,6 +384,7 @@ clientUpdateUrgency (Client *c) FLAG_UNSET (c->wm_flags, WM_FLAG_URGENT); c->blink_timeout_id = 0; + c->blink_iterations = 0; if ((c->wmhints) && (c->wmhints->flags & XUrgencyHint)) { FLAG_SET (c->wm_flags, WM_FLAG_URGENT); @@ -1639,6 +1652,9 @@ clientFrame (DisplayInfo *display_info, Window w, gboolean recapture) c->opacity_applied = c->opacity; c->opacity_flags = 0; + /* Keep count of blinking iterations */ + c->blink_iterations = 0; + if (getOpacityLock (display_info, c->window)) { FLAG_SET (c->xfwm_flags, XFWM_FLAG_OPACITY_LOCKED); diff --git a/src/client.h b/src/client.h index 9dcbe1bed23a204e7e4ca45ea0d1565df468e3f0..c15285c8ccc5807dbd646d99703397440526b633 100644 --- a/src/client.h +++ b/src/client.h @@ -102,13 +102,17 @@ #endif #ifndef CLIENT_BLINK_TIMEOUT -#define CLIENT_BLINK_TIMEOUT 500 /* ms */ +#define CLIENT_BLINK_TIMEOUT 200 /* ms */ #endif #ifndef CLIENT_PING_TIMEOUT #define CLIENT_PING_TIMEOUT 3000 /* ms */ #endif +#ifndef MAX_BLINK_ITERATIONS +#define MAX_BLINK_ITERATIONS 5 +#endif + #define XFWM_FLAG_HAS_BORDER (1L<<0) #define XFWM_FLAG_HAS_MENU (1L<<1) #define XFWM_FLAG_HAS_MAXIMIZE (1L<<2) @@ -286,6 +290,7 @@ struct _Client int previous_height; int initial_layer; int ncmap; + int blink_iterations; int button_status[BUTTON_COUNT]; int struts[STRUTS_SIZE]; gchar *hostname;