HWND old_active_window;
gboolean focus_on_map = FALSE;
DWORD exstyle;
- HWND top;
if (window->destroyed)
return;
exstyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE);
- if (window->state & GDK_WINDOW_STATE_BELOW)
- exstyle &= (~WS_EX_TOPMOST);
-
- if (window->state & GDK_WINDOW_STATE_ABOVE)
- exstyle |= WS_EX_TOPMOST;
-
- if (exstyle & WS_EX_TOPMOST)
- top = HWND_TOPMOST;
- else
- top = HWND_TOP;
-
/* Use SetWindowPos to show transparent windows so automatic redraws
* in other windows can be suppressed.
*/
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP || !focus_on_map)
flags |= SWP_NOACTIVATE;
- SetWindowPos (GDK_WINDOW_HWND (window), top, 0, 0, 0, 0, flags);
+ SetWindowPos (GDK_WINDOW_HWND (window), HWND_TOP, 0, 0, 0, 0, flags);
return;
}
{
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNORMAL);
}
+
+ /* Sync STATE_ABOVE to TOPMOST */
+ if (((window->state & GDK_WINDOW_STATE_ABOVE) &&
+ !(exstyle & WS_EX_TOPMOST)) ||
+ (!(window->state & GDK_WINDOW_STATE_ABOVE) &&
+ (exstyle & WS_EX_TOPMOST)))
+ {
+ API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
+ (window->state & GDK_WINDOW_STATE_ABOVE)?HWND_TOPMOST:HWND_NOTOPMOST,
+ 0, 0, 0, 0,
+ SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE));
+ }
}
static void
0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE));
}
- else
- gdk_synthesize_window_state (window,
- setting ? GDK_WINDOW_STATE_BELOW : GDK_WINDOW_STATE_ABOVE,
- setting ? GDK_WINDOW_STATE_ABOVE : 0);
+
+ gdk_synthesize_window_state (window,
+ setting ? GDK_WINDOW_STATE_BELOW : GDK_WINDOW_STATE_ABOVE,
+ setting ? GDK_WINDOW_STATE_ABOVE : 0);
}
static void
0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE));
}
- else
- gdk_synthesize_window_state (window,
- setting ? GDK_WINDOW_STATE_ABOVE : GDK_WINDOW_STATE_BELOW,
- setting ? GDK_WINDOW_STATE_BELOW : 0);
+
+ gdk_synthesize_window_state (window,
+ setting ? GDK_WINDOW_STATE_ABOVE : GDK_WINDOW_STATE_BELOW,
+ setting ? GDK_WINDOW_STATE_BELOW : 0);
}
static void