summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorhobbs <hobbs@noemail.net>2000-05-16 00:03:14 (GMT)
committerhobbs <hobbs@noemail.net>2000-05-16 00:03:14 (GMT)
commita22f047a109c70fdb375f80567ec0fd8fd0874d5 (patch)
tree9d8e693900f4e24372f47ff58b9c1583192f211a /win
parent193d1faaf483de282d1fbf5e523e1fa463ec367d (diff)
downloadtk-a22f047a109c70fdb375f80567ec0fd8fd0874d5.zip
tk-a22f047a109c70fdb375f80567ec0fd8fd0874d5.tar.gz
tk-a22f047a109c70fdb375f80567ec0fd8fd0874d5.tar.bz2
* win/tkWinWm.c (Tk_WmCmd): changed wm deiconify from using idle
callback to calling restack and focus code immediately. FossilOrigin-Name: b6e29fbba870fcc60af4592631a2acaed52c51cf
Diffstat (limited to 'win')
-rw-r--r--win/tkWinWm.c52
1 files changed, 6 insertions, 46 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index c0233cc..43f0a96 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.22.2.1 2000/05/12 21:04:16 hobbs Exp $
+ * RCS: @(#) $Id: tkWinWm.c,v 1.22.2.2 2000/05/16 00:03:15 hobbs Exp $
*/
#include "tkWinInt.h"
@@ -294,8 +294,6 @@ static void InvalidateSubTree _ANSI_ARGS_((TkWindow *winPtr,
Colormap colormap));
static int ParseGeometry _ANSI_ARGS_((Tcl_Interp *interp,
char *string, TkWindow *winPtr));
-static void RaiseWinWhenIdle _ANSI_ARGS_((
- ClientData clientData));
static void RefreshColormap _ANSI_ARGS_((Colormap colormap,
TkDisplay *dispPtr));
static void SetLimits _ANSI_ARGS_((HWND hwnd, MINMAXINFO *info));
@@ -1459,8 +1457,7 @@ Tk_WmCmd(clientData, interp, argc, argv)
* before it is deiconified by TkpWmSetState.
* Don't bother if we've never been mapped.
*/
- if ((wmPtr->flags & WM_UPDATE_PENDING) &&
- !(wmPtr->flags & WM_NEVER_MAPPED)) {
+ if (wmPtr->flags & WM_UPDATE_PENDING) {
Tcl_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr);
UpdateGeometryInfo((ClientData) winPtr);
}
@@ -1477,10 +1474,11 @@ Tk_WmCmd(clientData, interp, argc, argv)
/*
* Follow Windows-like style here, raising the window to the top.
- * Do this when idle, to not cause an unrefreshable window to
- * get mapped.
*/
- Tcl_DoWhenIdle(RaiseWinWhenIdle, (ClientData) winPtr);
+ TkWmRestackToplevel(winPtr, Above, NULL);
+ if (!(Tk_Attributes((Tk_Window) winPtr)->override_redirect)) {
+ TkSetFocusWin(winPtr, 1);
+ }
} else if ((c == 'f') && (strncmp(argv[1], "focusmodel", length) == 0)
&& (length >= 2)) {
if ((argc != 3) && (argc != 4)) {
@@ -4534,41 +4532,3 @@ TkWinSetForegroundWindow(winPtr)
SetForegroundWindow(Tk_GetHWND(winPtr->window));
}
}
-
-/*
- *----------------------------------------------------------------------
- *
- * RaiseWinWhenIdle --
- *
- * This procedure is invoked after a toplevel window is deiconified
- * and also as a when-idle procedure, to raise the toplevel window
- * to the top and force focus into it, if it isn't overridden.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The window will be raised to the top, and may receive focus.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-RaiseWinWhenIdle(clientData)
- ClientData clientData; /* Pointer to the window's record. */
-{
- register TkWindow *winPtr = (TkWindow *) clientData;
-
- if ((winPtr == NULL)
- || (winPtr->flags & (TK_ALREADY_DEAD|TK_DONT_DESTROY_WINDOW))) {
- return;
- }
- if (winPtr->wmInfoPtr->flags & WM_UPDATE_PENDING) {
- Tcl_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr);
- UpdateGeometryInfo((ClientData) winPtr);
- }
- TkWmRestackToplevel(winPtr, Above, NULL);
- if (!(Tk_Attributes((Tk_Window) winPtr)->override_redirect)) {
- TkSetFocusWin(winPtr, 1);
- }
-}