summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredman <redman>1999-03-01 19:35:28 (GMT)
committerredman <redman>1999-03-01 19:35:28 (GMT)
commitae8bded1462fdf8027bf827da04a18d65ae0a4a2 (patch)
tree4d46bbff43dfb4bcc070fd9b09cd19a7e850e568
parentcc7c8bb8b44c066149f590a3c5833366be256a08 (diff)
downloadtk-ae8bded1462fdf8027bf827da04a18d65ae0a4a2.zip
tk-ae8bded1462fdf8027bf827da04a18d65ae0a4a2.tar.gz
tk-ae8bded1462fdf8027bf827da04a18d65ae0a4a2.tar.bz2
Fix Bug IDs 951, 1174, 1176. Fix "focus -force" so that it correctly activates
the toplevel window.
-rw-r--r--win/tkWinInt.h4
-rw-r--r--win/tkWinPointer.c4
-rw-r--r--win/tkWinWm.c34
3 files changed, 37 insertions, 5 deletions
diff --git a/win/tkWinInt.h b/win/tkWinInt.h
index 7e9a3f7..45030e9 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.1.4.3 1999/02/11 04:13:51 stanton Exp $
+ * RCS: @(#) $Id: tkWinInt.h,v 1.1.4.4 1999/03/01 19:35:28 redman Exp $
*/
#ifndef _TKWININT
@@ -199,7 +199,7 @@ extern void TkWinWmStoreEmbedAssociation _ANSI_ARGS_((
TkWindow *winPtr, HWND hwnd));
extern void TkWinXCleanup _ANSI_ARGS_((HINSTANCE hInstance));
extern void TkWinXInit _ANSI_ARGS_((HINSTANCE hInstance));
-
+extern void TkWinSetForegroundWindow _ANSI_ARGS_((TkWindow *winPtr));
#endif /* _TKWININT */
diff --git a/win/tkWinPointer.c b/win/tkWinPointer.c
index 982e69c..a6bd4fb 100644
--- a/win/tkWinPointer.c
+++ b/win/tkWinPointer.c
@@ -9,7 +9,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.1.4.2 1999/02/11 04:13:51 stanton Exp $
+ * RCS: @(#) $Id: tkWinPointer.c,v 1.1.4.3 1999/03/01 19:35:28 redman Exp $
*/
#include "tkWinInt.h"
@@ -442,7 +442,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 bf2ff57..69b9aec 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.1.4.8 1999/02/26 02:24:45 redman Exp $
+ * RCS: @(#) $Id: tkWinWm.c,v 1.1.4.9 1999/03/01 19:35:28 redman Exp $
*/
#include "tkWinInt.h"
@@ -4269,3 +4269,35 @@ 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));
+ }
+}