summaryrefslogtreecommitdiffstats
path: root/win/tkWinWm.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2000-05-16 00:00:29 (GMT)
committerhobbs <hobbs>2000-05-16 00:00:29 (GMT)
commite9b9a30379c418aef68b46cc176290488638ee09 (patch)
tree0c3c3cefe8b1fff2d11db2544c1f67c70ab8d206 /win/tkWinWm.c
parent698e6260491555c0e947686a83d1fbab938f9102 (diff)
downloadtk-e9b9a30379c418aef68b46cc176290488638ee09.zip
tk-e9b9a30379c418aef68b46cc176290488638ee09.tar.gz
tk-e9b9a30379c418aef68b46cc176290488638ee09.tar.bz2
* win/tkWinWm.c (Tk_WmCmd): changed wm deiconify from using idle
callback to calling restack and focus code immediately.
Diffstat (limited to 'win/tkWinWm.c')
-rw-r--r--win/tkWinWm.c52
1 files changed, 6 insertions, 46 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 9049624..b4e1ed7 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.24 2000/05/13 00:01:56 hobbs Exp $
+ * RCS: @(#) $Id: tkWinWm.c,v 1.25 2000/05/16 00:00:29 hobbs Exp $
*/
#include "tkWinInt.h"
@@ -293,8 +293,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));
@@ -1458,8 +1456,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);
}
@@ -1476,10 +1473,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)) {
@@ -4533,41 +4531,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);
- }
-}