From 981e44f7800bff887f06bfaf145952fc45e327a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Mon, 5 Jan 2004 13:29:00 +0000 Subject: [PATCH] Fix leaking of button grabs. http://lists.kde.org/?l=kwin&m=107297332416607&w=2 svn path=/trunk/kdebase/kwin/; revision=276957 --- events.cpp | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/events.cpp b/events.cpp index ef569ab87c..02a4bb5dc9 100644 --- a/events.cpp +++ b/events.cpp @@ -908,14 +908,15 @@ void Client::grabButton( int modifier ) { 0, XCapL, XNumL, XNumL | XCapL, XScrL, XScrL | XCapL, - XScrL | XNumL, XScrL | XNumL | XCapL }; -for( int i = 0; - i < 8; - ++i ) - XGrabButton( qt_xdisplay(), AnyButton, - modifier | mods[ i ], - wrapperId(), FALSE, ButtonPressMask, - GrabModeSync, GrabModeAsync, None, None ); + XScrL | XNumL, XScrL | XNumL | XCapL + }; + for( int i = 0; + i < 8; + ++i ) + XGrabButton( qt_xdisplay(), AnyButton, + modifier | mods[ i ], + wrapperId(), FALSE, ButtonPressMask, + GrabModeSync, GrabModeAsync, None, None ); } void Client::ungrabButton( int modifier ) @@ -924,12 +925,13 @@ void Client::ungrabButton( int modifier ) { 0, XCapL, XNumL, XNumL | XCapL, XScrL, XScrL | XCapL, - XScrL | XNumL, XScrL | XNumL | XCapL }; -for( int i = 0; - i < 8; - ++i ) - XUngrabButton( qt_xdisplay(), AnyButton, - modifier | mods[ i ], wrapperId()); + XScrL | XNumL, XScrL | XNumL | XCapL + }; + for( int i = 0; + i < 8; + ++i ) + XUngrabButton( qt_xdisplay(), AnyButton, + modifier | mods[ i ], wrapperId()); } #undef XCapL #undef XNumL @@ -943,6 +945,7 @@ for( int i = 0; */ void Client::updateMouseGrab() { + XUngrabButton( qt_xdisplay(), AnyButton, AnyModifier, wrapperId()); if( isActive() ) { // remove the grab for no modifiers only if the window