summaryrefslogtreecommitdiffstats
path: root/generic/tkFocus.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-11-07 14:22:06 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-11-07 14:22:06 (GMT)
commit7c2c0457c19b2402027024104641230c5d849f27 (patch)
tree3a2bac232ac08eadf285f6ea9e5ecfb6225840d9 /generic/tkFocus.c
parentd46f6a75d7599a5039da02ebca198cc9676a9f07 (diff)
downloadtk-7c2c0457c19b2402027024104641230c5d849f27.zip
tk-7c2c0457c19b2402027024104641230c5d849f27.tar.gz
tk-7c2c0457c19b2402027024104641230c5d849f27.tar.bz2
[Bug 3574708]: Move window liveness checks to better location.
Diffstat (limited to 'generic/tkFocus.c')
-rw-r--r--generic/tkFocus.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/generic/tkFocus.c b/generic/tkFocus.c
index 4814c17..85093ee 100644
--- a/generic/tkFocus.c
+++ b/generic/tkFocus.c
@@ -160,9 +160,7 @@ Tk_FocusObjCmd(
if (newPtr == NULL) {
return TCL_ERROR;
}
- if (!(newPtr->flags & TK_ALREADY_DEAD)) {
- TkSetFocusWin(newPtr, 0);
- }
+ TkSetFocusWin(newPtr, 0);
return TCL_OK;
}
}
@@ -552,6 +550,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);
/*