summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordas <das>2008-06-12 17:09:15 (GMT)
committerdas <das>2008-06-12 17:09:15 (GMT)
commitd138809e01fb083798e63157cfe31863684854df (patch)
treeaad9c516eb4b0b59b9f1631e86eb007bc3861764
parenta11944430be54d3070d9bc3fd3f168c6b4c326f7 (diff)
downloadtk-d138809e01fb083798e63157cfe31863684854df.zip
tk-d138809e01fb083798e63157cfe31863684854df.tar.gz
tk-d138809e01fb083798e63157cfe31863684854df.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]
-rw-r--r--ChangeLog5
-rw-r--r--generic/tkPointer.c10
2 files changed, 9 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 82e75a5..ab291e8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2008-06-12 Daniel Steffen <das@users.sourceforge.net>
+ * 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]
+
* macosx/tkMacOSXXStubs.c: sync with core-8-5-branch.
* unix/tcl.m4 (SunOS-5.11): fix 64bit amd64 support with gcc & Sun cc.
diff --git a/generic/tkPointer.c b/generic/tkPointer.c
index 06e54ff..b8f3793 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.7 2002/08/31 06:12:25 das Exp $
+ * RCS: @(#) $Id: tkPointer.c,v 1.7.2.1 2008/06/12 17:09:16 das Exp $
*/
#include "tkInt.h"
@@ -317,14 +317,12 @@ Tk_UpdatePointer(tkwin, x, y, state)
/*
* 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);
}
/*