mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-16 21:50:34 +00:00
win32: properly handle show and focus
The first time a window is shown we should always call SW_SHOWNORMAL. Understand whether to call SW_SHOW or SW_SHOWNORMAL and the specific ones for the temporary windows depending on IsWindowVisible. This also fixes the problem when calling gtk_window_present and the window is snapped to the left or right of the screen. This patch is based on the patches provided by Yevgen Muntyan and Aleksander Morgado. https://bugzilla.gnome.org/show_bug.cgi?id=698652
This commit is contained in:
parent
07a994c89f
commit
eb555979db
@ -1132,11 +1132,18 @@ show_window_internal (GdkWindow *window,
|
||||
}
|
||||
else if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP || !focus_on_map)
|
||||
{
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNOACTIVATE);
|
||||
if (!IsWindowVisible (GDK_WINDOW_HWND (window)))
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNOACTIVATE);
|
||||
else
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNA);
|
||||
}
|
||||
else if (!IsWindowVisible (GDK_WINDOW_HWND (window)))
|
||||
{
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNORMAL);
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNORMAL);
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOW);
|
||||
}
|
||||
|
||||
/* Sync STATE_ABOVE to TOPMOST */
|
||||
@ -2996,8 +3003,10 @@ gdk_win32_window_focus (GdkWindow *window,
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWMAXIMIZED);
|
||||
else if (window->state & GDK_WINDOW_STATE_ICONIFIED)
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
|
||||
else
|
||||
else if (!IsWindowVisible (GDK_WINDOW_HWND (window)))
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNORMAL);
|
||||
else
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOW);
|
||||
|
||||
SetFocus (GDK_WINDOW_HWND (window));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user