[gtk+/gtk-2-24] win32: properly handle show and focus
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-24] win32: properly handle show and focus
- Date: Mon, 15 Feb 2016 08:00:28 +0000 (UTC)
commit 0517063d764eaa9ca5b6053e852cb45f054758b3
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Mon Feb 8 13:20:02 2016 +0100
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
gdk/win32/gdkwindow-win32.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index bef1c78..a82dc0f 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -1258,12 +1258,19 @@ 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
+ else if (!IsWindowVisible (GDK_WINDOW_HWND (window)))
{
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNORMAL);
}
+ else
+ {
+ ShowWindow (GDK_WINDOW_HWND (window), SW_SHOW);
+ }
/* Sync STATE_ABOVE to TOPMOST */
if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_TEMP &&
@@ -3719,8 +3726,10 @@ gdk_window_focus (GdkWindow *window,
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWMAXIMIZED);
else if (private->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));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]