From fc354e0cac7be6f862321458e39278b50bf2daac Mon Sep 17 00:00:00 2001 From: stanton Date: Thu, 4 Feb 1999 20:53:53 +0000 Subject: * 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. --- generic/tkFocus.c | 11 +++++++++-- 1 file 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; } -- cgit v0.12