summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <dkf@noemail.net>2009-07-22 07:51:29 (GMT)
committerdkf <dkf@noemail.net>2009-07-22 07:51:29 (GMT)
commit7014aa6c5d5651fab0f683474681e83a5b2e0236 (patch)
tree10d7470f5936197306c563ed96d29e07c91e9c34
parent5071d15f65dc8af0456c60aa152be185b1b80ad3 (diff)
downloadtk-7014aa6c5d5651fab0f683474681e83a5b2e0236.zip
tk-7014aa6c5d5651fab0f683474681e83a5b2e0236.tar.gz
tk-7014aa6c5d5651fab0f683474681e83a5b2e0236.tar.bz2
[Bug 2496114]: Ensure that focus desynchronization doesn't cause a crash.
FossilOrigin-Name: d4a0a9045d3b131a664ea4ecf1ffe0b4693ac536
-rw-r--r--ChangeLog5
-rw-r--r--generic/tkFocus.c14
2 files changed, 18 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index df8cdae..5a8d0f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-22 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkFocus.c (TkFocusDeadWindow): [Bug 2496114]: Ensure that
+ focus desynchronization doesn't cause a crash.
+
2009-04-30 Don Porter <dgp@users.sourceforge.net>
* win/tkWinPixmap.c (Tk_GetPixmap): [Bug 2080533]: Added patch that
diff --git a/generic/tkFocus.c b/generic/tkFocus.c
index 6976e23..1e9448e 100644
--- a/generic/tkFocus.c
+++ b/generic/tkFocus.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkFocus.c,v 1.10.2.1 2005/08/11 12:17:09 dkf Exp $
+ * RCS: @(#) $Id: tkFocus.c,v 1.10.2.2 2009/07/22 07:51:29 dkf Exp $
*/
#include "tkInt.h"
@@ -886,6 +886,18 @@ TkFocusDeadWindow(winPtr)
}
}
+ /*
+ * Occasionally, things can become unsynchronized. Move them back into
+ * synch now. [Bug 2496114]
+ */
+
+ if (displayFocusPtr->focusWinPtr == winPtr) {
+ if (dispPtr->focusDebug) {
+ printf("focus cleared after %s died\n", winPtr->pathName);
+ }
+ displayFocusPtr->focusWinPtr = NULL;
+ }
+
if (displayFocusPtr->focusOnMapPtr == winPtr) {
displayFocusPtr->focusOnMapPtr = NULL;
}