From 328c3132eb68f540d1a522b545828d31431456be Mon Sep 17 00:00:00 2001 From: dkf Date: Wed, 22 Jul 2009 05:35:38 +0000 Subject: [Bug 2496114]: Ensure that focus desynchronization doesn't cause a crash. --- ChangeLog | 5 +++++ generic/tkFocus.c | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f343ce1..6b20a57 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-07-22 Donal K. Fellows + + * generic/tkFocus.c (TkFocusDeadWindow): [Bug 2496114]: Ensure that + focus desynchronization doesn't cause a crash. + 2009-07-21 Donal K. Fellows * generic/tkFont.c (TkUnderlineAngledTextLayout): [Bug 2356057]: diff --git a/generic/tkFocus.c b/generic/tkFocus.c index b3696d1..1c8a682 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.21 2009/02/03 23:55:47 nijtmans Exp $ + * RCS: @(#) $Id: tkFocus.c,v 1.22 2009/07/22 05:35:38 dkf Exp $ */ #include "tkInt.h" @@ -859,6 +859,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; } -- cgit v0.12