WABA: Grab mouse while in Alt-Tab or Control-Tab mode. This prevents a bug

which otherwise would occur when you click on the Alt-Tab-window with the
mouse. I hope I didn't break anything because this X-stuff is rather mystical.

BTW Why does KWin get so many "MotionNotify" events when you move your mouse
across certain windows?

svn path=/trunk/kdebase/kwin/; revision=47554
This commit is contained in:
Waldo Bastian 2000-04-26 01:45:10 +00:00
parent 494a879f04
commit b33a6fa71e

View file

@ -292,6 +292,7 @@ bool Workspace::workspaceEvent( XEvent * e )
switch (e->type) {
case ButtonPress:
case ButtonRelease:
case MotionNotify:
break;
case UnmapNotify:
// this is special due to
@ -585,6 +586,12 @@ bool Workspace::keyPress(XKeyEvent key)
freeKeyboard(FALSE);
return TRUE;
}
XGrabPointer( qt_xdisplay(), root, TRUE,
(uint)(ButtonPressMask | ButtonReleaseMask |
ButtonMotionMask | EnterWindowMask |
LeaveWindowMask | PointerMotionMask),
GrabModeSync, GrabModeAsync,
None, None, kwin_time );
XGrabKeyboard(qt_xdisplay(),
root, FALSE,
GrabModeAsync, GrabModeAsync,
@ -610,6 +617,12 @@ bool Workspace::keyPress(XKeyEvent key)
// return TRUE;
// }
if (!control_grab){
XGrabPointer( qt_xdisplay(), root, TRUE,
(uint)(ButtonPressMask | ButtonReleaseMask |
ButtonMotionMask | EnterWindowMask |
LeaveWindowMask | PointerMotionMask),
GrabModeSync, GrabModeAsync,
None, None, kwin_time );
XGrabKeyboard(qt_xdisplay(),
root, FALSE,
GrabModeAsync, GrabModeAsync,
@ -626,6 +639,7 @@ bool Workspace::keyPress(XKeyEvent key)
if (control_grab || tab_grab){
if (kc == XK_Escape){
XUngrabKeyboard(qt_xdisplay(), kwin_time);
XUngrabPointer( qt_xdisplay(), kwin_time);
tab_box->hide();
tab_grab = FALSE;
control_grab = FALSE;
@ -652,6 +666,7 @@ bool Workspace::keyRelease(XKeyEvent key)
if (xmk->modifiermap[xmk->max_keypermod * Mod1MapIndex + i]
== key.keycode){
XUngrabKeyboard(qt_xdisplay(), kwin_time);
XUngrabPointer( qt_xdisplay(), kwin_time);
tab_box->hide();
tab_grab = false;
if ( tab_box->currentClient() ){
@ -665,6 +680,7 @@ bool Workspace::keyRelease(XKeyEvent key)
for (i=0; i<xmk->max_keypermod; i++)
if (xmk->modifiermap[xmk->max_keypermod * ControlMapIndex + i]
== key.keycode){
XUngrabPointer( qt_xdisplay(), kwin_time);
XUngrabKeyboard(qt_xdisplay(), kwin_time);
tab_box->hide();
control_grab = False;
@ -897,7 +913,6 @@ bool Workspace::hasCaption( const QString& caption )
*/
void Workspace::requestFocus( Client* c)
{
//TODO will be different for non-root clients. (subclassing?)
if ( !c ) {
focusToNull();