summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2009-07-22 07:51:29 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2009-07-22 07:51:29 (GMT)
commit6ed19f51971b743c2662f662f1e01bb267f03bb6 (patch)
tree10d7470f5936197306c563ed96d29e07c91e9c34 /generic
parent579ab5e960e65f97b4a8adcf61116797673ade04 (diff)
downloadtk-6ed19f51971b743c2662f662f1e01bb267f03bb6.zip
tk-6ed19f51971b743c2662f662f1e01bb267f03bb6.tar.gz
tk-6ed19f51971b743c2662f662f1e01bb267f03bb6.tar.bz2
[Bug 2496114]: Ensure that focus desynchronization doesn't cause a crash.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkFocus.c14
1 files changed, 13 insertions, 1 deletions
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;
}