summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordas <das>2008-06-12 17:09:11 (GMT)
committerdas <das>2008-06-12 17:09:11 (GMT)
commit566e71d20454532cdf0fdb82121121dfed49a701 (patch)
treec4be29cf015cf71988306ef1829c2adc9cd81217
parent10953d55e174e00f3586c1ef12a95a28d6d0d188 (diff)
downloadtk-566e71d20454532cdf0fdb82121121dfed49a701.zip
tk-566e71d20454532cdf0fdb82121121dfed49a701.tar.gz
tk-566e71d20454532cdf0fdb82121121dfed49a701.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 a19d2e0..6186ba8 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]
+
* unix/tcl.m4 (SunOS-5.11): fix 64bit amd64 support with gcc & Sun cc.
* unix/configure: autoconf-2.59
diff --git a/generic/tkPointer.c b/generic/tkPointer.c
index 3b38cbe..02203ae 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.10.4.1 2008/06/12 17:09:11 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);
}
/*