summaryrefslogtreecommitdiffstats
path: root/win/tkWinWm.c
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2009-06-02 09:41:42 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2009-06-02 09:41:42 (GMT)
commitcaa91573d1ffb67d97604b735dced193464c0bc3 (patch)
treeffbd02a952c624138f6aed53a94f537573a20140 /win/tkWinWm.c
parent473fe655bbd25c1af26b5f1f80c276a1a41e15fb (diff)
downloadtk-caa91573d1ffb67d97604b735dced193464c0bc3.zip
tk-caa91573d1ffb67d97604b735dced193464c0bc3.tar.gz
tk-caa91573d1ffb67d97604b735dced193464c0bc3.tar.bz2
[Bug 2799589] Backported fix for crash on delayed window activation.
Diffstat (limited to 'win/tkWinWm.c')
-rw-r--r--win/tkWinWm.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index b18318f..2af53eb 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinWm.c,v 1.124.2.5 2009/05/03 06:48:55 dkf Exp $
+ * RCS: @(#) $Id: tkWinWm.c,v 1.124.2.6 2009/06/02 09:41:42 patthoyts Exp $
*/
#include "tkWinInt.h"
@@ -8283,10 +8283,20 @@ ActivateWindow(
*/
if (winPtr) {
+ Window window;
if (TkGrabState(winPtr) != TK_GRAB_EXCLUDED) {
- SetFocus(Tk_GetHWND(winPtr->window));
+ window = winPtr->window;
} else {
- SetFocus(Tk_GetHWND(winPtr->dispPtr->grabWinPtr->window));
+ window = winPtr->dispPtr->grabWinPtr->window;
+ }
+
+ /*
+ * Ensure the window was not destroyed while we were postponing
+ * the activation [Bug 2799589]
+ */
+
+ if (window) {
+ SetFocus(Tk_GetHWND(window));
}
}