diff --git a/activation.cpp b/activation.cpp index 2e477d29be..676a310e2e 100644 --- a/activation.cpp +++ b/activation.cpp @@ -727,6 +727,7 @@ void Client::setActive( bool act) if( decoration != NULL ) decoration->activeChange(); updateMouseGrab(); + updateUrgency(); // demand attention again if it's still urgent } void Client::startupIdChanged() @@ -749,5 +750,10 @@ void Client::startupIdChanged() } } - +void Client::updateUrgency() + { + if( urgency ) + demandAttention(); + } + } // namespace diff --git a/client.cpp b/client.cpp index 176b2c9f5e..92f78aca9e 100644 --- a/client.cpp +++ b/client.cpp @@ -123,6 +123,7 @@ Client::Client( Workspace *ws ) noborder = false; user_noborder = false; not_obscured = false; + urgency = false; Pdeletewindow = 0; Ptakefocus = 0; @@ -1224,15 +1225,18 @@ void Client::getWMHints() XWMHints *hints = XGetWMHints(qt_xdisplay(), window() ); input = true; window_group = None; + urgency = false; if ( hints ) { - if ( hints->flags & InputHint ) + if( hints->flags & InputHint ) input = hints->input; if( hints->flags & WindowGroupHint ) window_group = hints->window_group; - XFree((char*)hints); + urgency = ( hints->flags & UrgencyHint ) ? true : false; // true/false needed, it's uint bitfield + XFree( (char*)hints ); } checkGroup(); + updateUrgency(); updateAllowedActions(); // group affects isMinimizable() } diff --git a/client.h b/client.h index 5218b9b75a..63b261a9c0 100644 --- a/client.h +++ b/client.h @@ -346,6 +346,7 @@ class Client : public QObject, public KDecorationDefines void pingWindow(); void killProcess( bool ask, Time timestamp = CurrentTime ); + void updateUrgency(); void embedClient( Window w ); void detectNoBorder(); @@ -424,6 +425,7 @@ class Client : public QObject, public KDecorationDefines uint noborder : 1; uint user_noborder : 1; uint not_obscured : 1; + uint urgency : 1; // XWMHints, UrgencyHint void getWMHints(); void readIcons(); void getWindowProtocols(); diff --git a/utils.h b/utils.h index f8f423622d..d2ae3e8a98 100644 --- a/utils.h +++ b/utils.h @@ -132,6 +132,10 @@ class KWinSelectionOwner QCString getStringProperty(WId w, Atom prop, char separator=0); void kwin_updateTime(); +// the docs say it's UrgencyHint, but it's often #defined as XUrgencyHint +#ifndef UrgencyHint +#define UrgencyHint XUrgencyHint +#endif // for STL-like algo's #define KWIN_CHECK_PREDICATE( name, check ) \