summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorstanton <stanton@noemail.net>1999-02-04 20:53:53 (GMT)
committerstanton <stanton@noemail.net>1999-02-04 20:53:53 (GMT)
commit4d2adf162b0b87e193a1141a098e569563e91311 (patch)
tree6aa2137562959bf3868797b0d189eee368fcf383 /generic
parentd6e21413d18703e62e695fcad6a7bbe3620011e0 (diff)
downloadtk-4d2adf162b0b87e193a1141a098e569563e91311.zip
tk-4d2adf162b0b87e193a1141a098e569563e91311.tar.gz
tk-4d2adf162b0b87e193a1141a098e569563e91311.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. FossilOrigin-Name: 75cfe78bd38999509e3e41543885f3f6a50353c0
Diffstat (limited to 'generic')
-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;
}