summaryrefslogtreecommitdiffstats
path: root/generic/tkFocus.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2009-07-22 07:46:42 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2009-07-22 07:46:42 (GMT)
commit1a37ea60d555b5ff880938e379591386d2578f2e (patch)
treebb6570da9b5ce82f00d1ad6eefe46c363ed7e084 /generic/tkFocus.c
parent35987bce60a984aa06f0f4584ee87933cf16fbda (diff)
downloadtk-1a37ea60d555b5ff880938e379591386d2578f2e.zip
tk-1a37ea60d555b5ff880938e379591386d2578f2e.tar.gz
tk-1a37ea60d555b5ff880938e379591386d2578f2e.tar.bz2
[Bug 2496114]: Ensure that focus desynchronization doesn't cause a crash.
Diffstat (limited to 'generic/tkFocus.c')
-rw-r--r--generic/tkFocus.c12
1 files changed, 11 insertions, 1 deletions
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;
}