summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordas <das@noemail.net>2008-06-12 17:08:58 (GMT)
committerdas <das@noemail.net>2008-06-12 17:08:58 (GMT)
commit0cbfae988167442bb0078533af9fc5083771663f (patch)
treee8274ebca07d7ba94dd574e24b4c05d5fc7307cf /generic
parentc64b2c6d63547b27770eb49317660c49bacda8d1 (diff)
downloadtk-0cbfae988167442bb0078533af9fc5083771663f.zip
tk-0cbfae988167442bb0078533af9fc5083771663f.tar.gz
tk-0cbfae988167442bb0078533af9fc5083771663f.tar.bz2
* generic/tkPointer.c (Tk_UpdatePointer): fix failure to restore a
global grab capture and to release the restrict window capture when releasing a button grab. Fixes segfault due to dangling reference to restrict window inside TkpSetCapture() implementation. [Bug 1991932] FossilOrigin-Name: 2c73237a099866d9ba3e137f5e68ecf0975f7ed0
Diffstat (limited to 'generic')
-rw-r--r--generic/tkPointer.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/generic/tkPointer.c b/generic/tkPointer.c
index 3b38cbe..99b61b7 100644
--- a/generic/tkPointer.c
+++ b/generic/tkPointer.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkPointer.c,v 1.10 2005/11/15 15:18:22 dkf Exp $
+ * RCS: @(#) $Id: tkPointer.c,v 1.11 2008/06/12 17:08:59 das Exp $
*/
#include "tkInt.h"
@@ -309,14 +309,12 @@ Tk_UpdatePointer(
/*
* ButtonRelease - Release the mouse capture and clear the
- * restrict window when the last button is released and we
- * aren't in a global grab.
+ * restrict window when the last button is released. If we
+ * are in a global grab, restore the grab window capture.
*/
if ((tsdPtr->lastState & ALL_BUTTONS) == mask) {
- if (!tsdPtr->grabWinPtr) {
- TkpSetCapture(NULL);
- }
+ TkpSetCapture(tsdPtr->grabWinPtr);
}
/*