Support for UrgencyHint - such windows are demanding attention when inactive.

svn path=/trunk/kdebase/kwin/; revision=257691
This commit is contained in:
Luboš Luňák 2003-10-10 11:23:42 +00:00
parent 128085b3d7
commit 2981785b56
4 changed files with 19 additions and 3 deletions

View file

@ -727,6 +727,7 @@ void Client::setActive( bool act)
if( decoration != NULL ) if( decoration != NULL )
decoration->activeChange(); decoration->activeChange();
updateMouseGrab(); updateMouseGrab();
updateUrgency(); // demand attention again if it's still urgent
} }
void Client::startupIdChanged() void Client::startupIdChanged()
@ -749,5 +750,10 @@ void Client::startupIdChanged()
} }
} }
void Client::updateUrgency()
{
if( urgency )
demandAttention();
}
} // namespace } // namespace

View file

@ -123,6 +123,7 @@ Client::Client( Workspace *ws )
noborder = false; noborder = false;
user_noborder = false; user_noborder = false;
not_obscured = false; not_obscured = false;
urgency = false;
Pdeletewindow = 0; Pdeletewindow = 0;
Ptakefocus = 0; Ptakefocus = 0;
@ -1224,15 +1225,18 @@ void Client::getWMHints()
XWMHints *hints = XGetWMHints(qt_xdisplay(), window() ); XWMHints *hints = XGetWMHints(qt_xdisplay(), window() );
input = true; input = true;
window_group = None; window_group = None;
urgency = false;
if ( hints ) if ( hints )
{ {
if ( hints->flags & InputHint ) if( hints->flags & InputHint )
input = hints->input; input = hints->input;
if( hints->flags & WindowGroupHint ) if( hints->flags & WindowGroupHint )
window_group = hints->window_group; 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(); checkGroup();
updateUrgency();
updateAllowedActions(); // group affects isMinimizable() updateAllowedActions(); // group affects isMinimizable()
} }

View file

@ -346,6 +346,7 @@ class Client : public QObject, public KDecorationDefines
void pingWindow(); void pingWindow();
void killProcess( bool ask, Time timestamp = CurrentTime ); void killProcess( bool ask, Time timestamp = CurrentTime );
void updateUrgency();
void embedClient( Window w ); void embedClient( Window w );
void detectNoBorder(); void detectNoBorder();
@ -424,6 +425,7 @@ class Client : public QObject, public KDecorationDefines
uint noborder : 1; uint noborder : 1;
uint user_noborder : 1; uint user_noborder : 1;
uint not_obscured : 1; uint not_obscured : 1;
uint urgency : 1; // XWMHints, UrgencyHint
void getWMHints(); void getWMHints();
void readIcons(); void readIcons();
void getWindowProtocols(); void getWindowProtocols();

View file

@ -132,6 +132,10 @@ class KWinSelectionOwner
QCString getStringProperty(WId w, Atom prop, char separator=0); QCString getStringProperty(WId w, Atom prop, char separator=0);
void kwin_updateTime(); 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 // for STL-like algo's
#define KWIN_CHECK_PREDICATE( name, check ) \ #define KWIN_CHECK_PREDICATE( name, check ) \