summaryrefslogtreecommitdiffstats
path: root/generic/tkFocus.c
diff options
context:
space:
mode:
authorstanton <stanton>1999-02-04 20:53:53 (GMT)
committerstanton <stanton>1999-02-04 20:53:53 (GMT)
commitfc354e0cac7be6f862321458e39278b50bf2daac (patch)
tree6aa2137562959bf3868797b0d189eee368fcf383 /generic/tkFocus.c
parent34b465e85f0f2b75425a4ecf210d4e81a3d4689a (diff)
downloadtk-fc354e0cac7be6f862321458e39278b50bf2daac.zip
tk-fc354e0cac7be6f862321458e39278b50bf2daac.tar.gz
tk-fc354e0cac7be6f862321458e39278b50bf2daac.tar.bz2
* generic/tkFocus.c (SetFocus): Changed to focus window is always
set if -force is specified. This fixes the problem on Windows where Tk does not activate the window if it already has focus.
Diffstat (limited to 'generic/tkFocus.c')
-rw-r--r--generic/tkFocus.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/generic/tkFocus.c b/generic/tkFocus.c
index 75c10bb..0db24ff 100644
--- a/generic/tkFocus.c
+++ b/generic/tkFocus.c
@@ -10,7 +10,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.2 1998/09/14 18:23:10 stanton Exp $
+ * RCS: @(#) $Id: tkFocus.c,v 1.3 1999/02/04 20:53:53 stanton Exp $
*/
#include "tkInt.h"
@@ -550,7 +550,14 @@ SetFocus(winPtr, force)
int allMapped, serial;
displayFocusPtr = FindDisplayFocusInfo(winPtr->mainPtr, winPtr->dispPtr);
- if (winPtr == displayFocusPtr->focusWinPtr) {
+
+ /*
+ * If force is set, we should make sure we grab the focus regardless
+ * of the current focus window since under Windows, we may need to
+ * take control away from another application.
+ */
+
+ if (winPtr == displayFocusPtr->focusWinPtr && !force) {
return;
}