GNOME Bugzilla – Bug 528975
Can not maximize the window
Last modified: 2008-08-28 02:43:56 UTC
Please describe the problem: The window cannot restore to the maximum size after restore from task bar. Below is a simple example. #include <gtk/gtk.h> int main( int argc, char *argv[] ) { GtkWidget *window; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); g_signal_connect (G_OBJECT (window), "delete_event", G_CALLBACK (gtk_main_quit), NULL); gtk_widget_show (window); gtk_main (); return 0; } Steps to reproduce: 1. Maximize a window 2. Minimize the window 3. Restore the window Actual results: You will find the window will not be the maximum status. It can only be the original size before maximized. Expected results: You will find the window will not be the maximum status. It can only be the original size before maximized. Does this happen every time? Yes Other information:
This has already been fixed in trunk and gtk-2-12 branches, but I don't remember which revision it went in. Closing as OBSOLETE.
I am using latest GTK+ 2.12.9 and still get this issue. Do you mean the fix will go in next GTK+ release?
That's right. I believe this was fixed in the patch for bug #518846 on 2008-03-23 (2.12.9 was released 2008-03-12).
This does not seem to be fixed in current gtk-2-12 (or trunk). At least not for me. Does it really work for you bratsche?
You're right.. debugging now.
So if we minimize a window and then restore it, we're hitting WM_SIZE twice. If the window was not maximized before it was minimized we get: WM_SIZE wParam:SIZE_RESTORED WM_SIZE wParam:SIZE_RESTORED If we minimize a maximized window, and then restore that window we get: WM_SIZE wParam:SIZE_MAXIMIZED WM_SIZE wParam:SIZE_RESTORED I'm trying to figure out what is causing that second event to occur.
Created attachment 112784 [details] [review] Patch Need to test this against some of the transient/modal window tests still.
*** Bug 549475 has been marked as a duplicate of this bug. ***
2008-08-27 Cody Russell <bratsche@gnome.org> * gdk/win32/gdkevents-win32.c: * gdk/win32/gdkwindow-win32.c (show_window_recurse): Check if the window's state has GDK_WINDOW_STATE_MAXIMIZED set before calling ShowWindow (), and show using SW_SHOWMAXIMIZED or SW_RESTORE accordingly. This fixes an issue where maximized windows that are iconified do not restore back to maximized when you click the taskbar. (#528975)
Also merged into gtk-2-12 branch.