summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-11-07 14:23:34 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-11-07 14:23:34 (GMT)
commit94ee921c9a1cc92e24329bf1662aac13751fe763 (patch)
tree99a0c54004df193333f869b78f209f6f138fad17 /generic
parentf339d11a14d762ffea8d324dc90f4fd57206adbe (diff)
parent7a9728f81b02f84b4d10e87ae7cfde37f65e9e79 (diff)
downloadtk-94ee921c9a1cc92e24329bf1662aac13751fe763.zip
tk-94ee921c9a1cc92e24329bf1662aac13751fe763.tar.gz
tk-94ee921c9a1cc92e24329bf1662aac13751fe763.tar.bz2
[Bug 3574708]: Move window liveness checks to better location.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkFocus.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/generic/tkFocus.c b/generic/tkFocus.c
index b5e2edf..cfd2216 100644
--- a/generic/tkFocus.c
+++ b/generic/tkFocus.c
@@ -153,9 +153,7 @@ Tk_FocusObjCmd(
if (newPtr == NULL) {
return TCL_ERROR;
}
- if (!(newPtr->flags & TK_ALREADY_DEAD)) {
- TkSetFocusWin(newPtr, 0);
- }
+ TkSetFocusWin(newPtr, 0);
return TCL_OK;
}
}
@@ -545,6 +543,14 @@ TkSetFocusWin(
TkWindow *topLevelPtr;
int allMapped, serial;
+ /*
+ * Don't set focus if window is already dead. [Bug 3574708]
+ */
+
+ if (winPtr->flags & TK_ALREADY_DEAD) {
+ return;
+ }
+
displayFocusPtr = FindDisplayFocusInfo(winPtr->mainPtr, winPtr->dispPtr);
/*