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