summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorredman <redman>1999-03-10 19:29:24 (GMT)
committerredman <redman>1999-03-10 19:29:24 (GMT)
commit79af7a3035aee0515128033a6b0af599d1a29801 (patch)
tree3d1fd36e76f149caa4d65870b7aa310f6864d4a9 /win
parent824bd0f38f575bdd5a561fd96eb625748cf340f9 (diff)
downloadtk-79af7a3035aee0515128033a6b0af599d1a29801.zip
tk-79af7a3035aee0515128033a6b0af599d1a29801.tar.gz
tk-79af7a3035aee0515128033a6b0af599d1a29801.tar.bz2
Backported "focus -force" patch from 8.1.
Diffstat (limited to 'win')
-rw-r--r--win/tkWinInt.h3
-rw-r--r--win/tkWinPointer.c4
-rw-r--r--win/tkWinWm.c33
3 files changed, 36 insertions, 4 deletions
diff --git a/win/tkWinInt.h b/win/tkWinInt.h
index b1ab878..816e483 100644
--- a/win/tkWinInt.h
+++ b/win/tkWinInt.h
@@ -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: tkWinInt.h,v 1.4 1999/03/10 07:04:46 stanton Exp $
+ * RCS: @(#) $Id: tkWinInt.h,v 1.5 1999/03/10 19:29:24 redman Exp $
*/
#ifndef _TKWININT
@@ -148,6 +148,7 @@ extern int tkpWinRopModes[];
#include "tkIntPlatDecls.h"
+extern void TkWinSetForegroundWindow(TkWindow *winPtr);
extern LRESULT CALLBACK TkWinChildProc (HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam);
diff --git a/win/tkWinPointer.c b/win/tkWinPointer.c
index e9c94be..289ff4b 100644
--- a/win/tkWinPointer.c
+++ b/win/tkWinPointer.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinPointer.c,v 1.4 1999/02/04 21:00:57 stanton Exp $
+ * RCS: @(#) $Id: tkWinPointer.c,v 1.5 1999/03/10 19:29:24 redman Exp $
*/
#include "tkWinInt.h"
@@ -441,7 +441,7 @@ TkpChangeFocus(winPtr, force)
*/
if (force) {
- SetForegroundWindow(Tk_GetHWND(winPtr->window));
+ TkWinSetForegroundWindow(winPtr);
}
XSetInputFocus(dispPtr->display, winPtr->window, RevertToParent,
CurrentTime);
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 98414e2..a0ed0ae 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinWm.c,v 1.6 1999/02/04 21:01:46 stanton Exp $
+ * RCS: @(#) $Id: tkWinWm.c,v 1.7 1999/03/10 19:29:24 redman Exp $
*/
#include "tkWinInt.h"
@@ -4235,3 +4235,34 @@ ActivateWindow(
return 1;
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkWinSetForegroundWindow --
+ *
+ * This function is a wrapper for SetForegroundWindow, calling
+ * it on the wrapper window because it has no affect on child
+ * windows.
+ *
+ * Results:
+ * none
+ *
+ * Side effects:
+ * May activate the toplevel window.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkWinSetForegroundWindow(winPtr)
+ TkWindow *winPtr;
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+
+ if (wmPtr->wrapper != NULL) {
+ SetForegroundWindow(wmPtr->wrapper);
+ } else {
+ SetForegroundWindow(Tk_GetHWND(winPtr->window));
+ }
+}