summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <dkf@noemail.net>2009-07-22 07:46:41 (GMT)
committerdkf <dkf@noemail.net>2009-07-22 07:46:41 (GMT)
commit7f4caee57dc2d74f6d5f4fc5e94962b4fb2a1f0c (patch)
treebb6570da9b5ce82f00d1ad6eefe46c363ed7e084
parent2c98f33a75c6246b1d71d3e95787cc2c2c8747c0 (diff)
downloadtk-7f4caee57dc2d74f6d5f4fc5e94962b4fb2a1f0c.zip
tk-7f4caee57dc2d74f6d5f4fc5e94962b4fb2a1f0c.tar.gz
tk-7f4caee57dc2d74f6d5f4fc5e94962b4fb2a1f0c.tar.bz2
[Bug 2496114]: Ensure that focus desynchronization doesn't cause a crash.
FossilOrigin-Name: 24905e9b21e74bbdd22e985f4cab43e440067bc4
-rw-r--r--ChangeLog5
-rw-r--r--generic/tkFocus.c12
2 files changed, 16 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 626800a..f25103b 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-07-20 Donal K. Fellows <dkf@users.sf.net>
* tests/clipboard.test (clipboard-6.2): [Bug 2824378]: Corrected
diff --git a/generic/tkFocus.c b/generic/tkFocus.c
index e524c16..e00c4e2 100644
--- a/generic/tkFocus.c
+++ b/generic/tkFocus.c
@@ -9,7 +9,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.16 2007/12/13 15:24:14 dgp Exp $
+ * RCS: @(#) $Id: tkFocus.c,v 1.16.2.1 2009/07/22 07:46:42 dkf Exp $
*/
#include "tkInt.h"
@@ -869,6 +869,16 @@ TkFocusDeadWindow(
}
}
+ /*
+ * Occasionally, things can become unsynchronized. Move them back into
+ * synch now. [Bug 2496114]
+ */
+
+ if (displayFocusPtr->focusWinPtr == winPtr) {
+ DEBUG(dispPtr, ("focus cleared after %s died\n", winPtr->pathName));
+ displayFocusPtr->focusWinPtr = NULL;
+ }
+
if (displayFocusPtr->focusOnMapPtr == winPtr) {
displayFocusPtr->focusOnMapPtr = NULL;
}