smarter autoRaise, wondering what it breaks this time

svn path=/trunk/kdebase/kwin/; revision=76893
This commit is contained in:
Matthias Ettrich 2001-01-08 09:52:44 +00:00
parent a656ae84be
commit 45f2bbd3d3
2 changed files with 20 additions and 2 deletions

View file

@ -1960,7 +1960,7 @@ bool Client::x11Event( XEvent * e)
&& workspace()->topClientOnDesktop() != this ) {
delete autoRaiseTimer;
autoRaiseTimer = new QTimer( this );
connect( autoRaiseTimer, SIGNAL( timeout() ), this, SLOT( autoRaise() ) );
connect( autoRaiseTimer, SIGNAL( timeout() ), this, SLOT( autoRaiseTimerDone() ) );
autoRaiseTimer->start( options->autoRaiseInterval, TRUE );
}
@ -2810,6 +2810,23 @@ void Client::autoRaise()
autoRaiseTimer = 0;
}
void Client::autoRaiseTimerDone()
{
// ensure there's no popup menu open
if ( XGrabPointer( qt_xdisplay(), workspace()->rootWin(), TRUE,
(uint)(ButtonPressMask | ButtonReleaseMask |
ButtonMotionMask | EnterWindowMask |
LeaveWindowMask | PointerMotionMask),
GrabModeAsync, GrabModeAsync,
None, None, kwin_time ) == GrabSuccess ) {
XUngrabPointer( qt_xdisplay(), kwin_time);
autoRaise();
} else {
// if there is, try again
autoRaiseTimer->start( options->autoRaiseInterval, TRUE );
}
}
/*!
Clones settings from other client. Used in
Workspace::slotResetAllClients()

View file

@ -194,6 +194,7 @@ public slots:
void toggleSticky();
void contextHelp();
void autoRaise();
void autoRaiseTimerDone();
protected:
void paintEvent( QPaintEvent * );