smarter autoRaise, wondering what it breaks this time
svn path=/trunk/kdebase/kwin/; revision=76893
This commit is contained in:
parent
a656ae84be
commit
45f2bbd3d3
2 changed files with 20 additions and 2 deletions
19
client.cpp
19
client.cpp
|
@ -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()
|
||||
|
|
1
client.h
1
client.h
|
@ -194,6 +194,7 @@ public slots:
|
|||
void toggleSticky();
|
||||
void contextHelp();
|
||||
void autoRaise();
|
||||
void autoRaiseTimerDone();
|
||||
|
||||
protected:
|
||||
void paintEvent( QPaintEvent * );
|
||||
|
|
Loading…
Reference in a new issue