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 ) { && workspace()->topClientOnDesktop() != this ) {
delete autoRaiseTimer; delete autoRaiseTimer;
autoRaiseTimer = new QTimer( this ); autoRaiseTimer = new QTimer( this );
connect( autoRaiseTimer, SIGNAL( timeout() ), this, SLOT( autoRaise() ) ); connect( autoRaiseTimer, SIGNAL( timeout() ), this, SLOT( autoRaiseTimerDone() ) );
autoRaiseTimer->start( options->autoRaiseInterval, TRUE ); autoRaiseTimer->start( options->autoRaiseInterval, TRUE );
} }
@ -2810,6 +2810,23 @@ void Client::autoRaise()
autoRaiseTimer = 0; 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 Clones settings from other client. Used in
Workspace::slotResetAllClients() Workspace::slotResetAllClients()

View file

@ -48,7 +48,7 @@ protected:
private slots: private slots:
void deferredResize(); void deferredResize();
private: private:
WId win; WId win;
Time lastMouseEventTime; Time lastMouseEventTime;
@ -194,6 +194,7 @@ public slots:
void toggleSticky(); void toggleSticky();
void contextHelp(); void contextHelp();
void autoRaise(); void autoRaise();
void autoRaiseTimerDone();
protected: protected:
void paintEvent( QPaintEvent * ); void paintEvent( QPaintEvent * );