[gtk+/gtk-2-24] win32: on focus restore the window if iconified



commit 2299a98a5d02cf74d4beae47902cc3a5e1f9723e
Author: Yevgen Muntyan <muntyan fastmail fm>
Date:   Mon Feb 8 09:24:12 2016 +0100

    win32: on focus restore the window if iconified
    
    If the window is iconified we want to restore the window
    to get the proper size instead of showing it normal which
    would change the size of the window.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=698652

 gdk/win32/gdkwindow-win32.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index bd64237..bef1c78 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -3702,19 +3702,26 @@ void
 gdk_window_focus (GdkWindow *window,
                   guint32    timestamp)
 {
+  GdkWindowObject *private;
+
   g_return_if_fail (GDK_IS_WINDOW (window));
 
   if (GDK_WINDOW_DESTROYED (window))
     return;
-  
+
+  private = (GdkWindowObject *)window;
+
   GDK_NOTE (MISC, g_print ("gdk_window_focus: %p: %s\n",
                           GDK_WINDOW_HWND (window),
                           _gdk_win32_window_state_to_string (((GdkWindowObject *) window)->state)));
 
-  if (((GdkWindowObject *) window)->state & GDK_WINDOW_STATE_MAXIMIZED)
+  if (private->state & GDK_WINDOW_STATE_MAXIMIZED)
     ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWMAXIMIZED);
+  else if (private->state & GDK_WINDOW_STATE_ICONIFIED)
+    ShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
   else
     ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNORMAL);
+
   SetFocus (GDK_WINDOW_HWND (window));
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]