GNOME Bugzilla – Bug 518846
Restore toplevel maximized window
Last modified: 2008-03-23 15:38:45 UTC
Please describe the problem: Open popup window from maximized main one imply restore of main window to his original size. Steps to reproduce: 1. First toplevel window must but miximized or fullscreen mode. 2. Application need to have menu tearoffs enable. Use tearoffs, window detach from the menu and main maximized window is restored. It's like you checked the restore button on decoration window. 3. We use also gtk_window_get_transient_for() and same problem happen when we call this fonction for a popup window. Actual results: Maximised windows is restored. Expected results: Maximised windows don't change. Does this happen every time? YES Other information: I don't have time to compile by myself library but I give my point of view without check. I suppose the problem can be solve by it. --- gdkevents-win32.c.orig 2008-02-26 14:28:41.000000000 +0100 +++ gdkevents-win32.c 2008-02-26 14:29:05.000000000 +0100 @@ -1305,7 +1305,7 @@ if (GDK_WINDOW_IS_MAPPED (window)) { if (!hide_window) - ShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE); + ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNORMAL); else ShowWindow (GDK_WINDOW_HWND (window), SW_MINIMIZE); } In fact, recursive calls make all windows to restore instead of just keep their size. Prehaps SW_SHOW, SW_SHOWNA, SW_SHOWNOACTIVATE can be better but you have to choose what you really need. (refer to http://msdn2.microsoft.com/en-us/library/ms633548(VS.85).aspx)
Can you write a very simple test program that shows the problem?
Created attachment 106150 [details] test program
Created attachment 106151 [details] XML menu needed to be load by main prog
First, it's lot of pain to report a bug :) Anyway, I have stole a little program onto forum and adapted fast to reproduce the bug. So, don't care about good use of gtk_window_set_transient_for() or not. It's just a way to reproduce bug. Compile it and run it with the xml file menu in same directory. Start program and maximize window (usally you have button at rigth corner :D). DON'T RESIZE yourself the windwos because restore function will be hidden. First test to do is tearoff. Open a menu and use tearoff to detach -> enjoy restore main window Remaximize and press on "Ouvrir" (open icon on tools bar or menu fichier -> ouvrir) -> enjoy restore main window
Thanks a lot Carl! I'll look into this.
2008-03-23 Cody Russell <bratsche@gnome.org> * gdk/win32/gdkevents-win32.c (show_window_recurse): Check window state for GDK_WINDOW_STATE_ICONIFIED before doing ShowWindow (SW_RESTORE). This fixes a problem where tearing off menus from a maximized window would force the window to restore its size. (#518846)