some focus follows mouse stuff
svn path=/trunk/kdebase/kwin/; revision=60885
This commit is contained in:
parent
dc9fb7dc2b
commit
81bd6b26c3
3 changed files with 18 additions and 8 deletions
|
@ -195,7 +195,8 @@ WindowWrapper::WindowWrapper( WId w, Client *parent, const char* name)
|
|||
|
||||
XSelectInput( qt_xdisplay(), w,
|
||||
FocusChangeMask |
|
||||
PropertyChangeMask
|
||||
PropertyChangeMask |
|
||||
EnterWindowMask | LeaveWindowMask
|
||||
);
|
||||
|
||||
// install a passive grab to catch mouse button events
|
||||
|
@ -1702,6 +1703,7 @@ bool Client::x11Event( XEvent * e)
|
|||
workspace()->requestFocus( this );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ( e->type == LeaveNotify && e->xcrossing.mode == NotifyNormal ) {
|
||||
if ( !buttonDown )
|
||||
setCursor( arrowCursor );
|
||||
|
@ -1709,12 +1711,13 @@ bool Client::x11Event( XEvent * e)
|
|||
if ( lostMouse ) {
|
||||
delete autoRaiseTimer;
|
||||
autoRaiseTimer = 0;
|
||||
}
|
||||
}
|
||||
if ( options->focusPolicy == Options::FocusStrictlyUnderMouse )
|
||||
if ( isActive() && lostMouse )
|
||||
workspace()->requestFocus( 0 ) ;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
4
main.cpp
4
main.cpp
|
@ -45,8 +45,8 @@ static DCOPClient * client = 0;
|
|||
static void crashHandler(int)
|
||||
{
|
||||
KCrash::setCrashHandler(0); // Exit on next crash.
|
||||
delete client; client = 0; // Unregister with dcop.
|
||||
system("kwin&"); // Try to restart
|
||||
client->detach(); // Unregister with dcop.
|
||||
// system("kwin&"); // Try to restart
|
||||
}
|
||||
|
||||
int x11ErrorHandler(Display *d, XErrorEvent *e){
|
||||
|
|
|
@ -470,6 +470,12 @@ bool Workspace::workspaceEvent( XEvent * e )
|
|||
}
|
||||
break;
|
||||
case EnterNotify:
|
||||
qDebug("EnterNotify");
|
||||
{
|
||||
QWidget* w = QWidget::find( e->xcrossing.window );
|
||||
if (w )
|
||||
qDebug("w = %s", w->className() );
|
||||
}
|
||||
if ( !QWhatsThis::inWhatsThisMode() )
|
||||
break;
|
||||
{
|
||||
|
@ -479,6 +485,7 @@ bool Workspace::workspaceEvent( XEvent * e )
|
|||
}
|
||||
break;
|
||||
case LeaveNotify:
|
||||
qDebug("LeaveNotify");
|
||||
if ( !QWhatsThis::inWhatsThisMode() )
|
||||
break;
|
||||
c = findClientWidthId( e->xcrossing.window );
|
||||
|
@ -1626,7 +1633,7 @@ void Workspace::raiseClient( Client* c )
|
|||
|
||||
|
||||
propagateClients( TRUE );
|
||||
|
||||
|
||||
if ( tab_box->isVisible() )
|
||||
tab_box->raise();
|
||||
}
|
||||
|
@ -2073,13 +2080,13 @@ void Workspace::slotWindowLower()
|
|||
*/
|
||||
void Workspace::slotMouseEmulation()
|
||||
{
|
||||
|
||||
|
||||
if ( mouse_emulation ) {
|
||||
XUngrabKeyboard(qt_xdisplay(), kwin_time);
|
||||
mouse_emulation = FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( XGrabKeyboard(qt_xdisplay(),
|
||||
root, FALSE,
|
||||
GrabModeAsync, GrabModeAsync,
|
||||
|
|
Loading…
Reference in a new issue