After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 528975 - Can not maximize the window
Can not maximize the window
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Win32
2.12.x
Other All
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-bugs
: 549475 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-04-20 02:01 UTC by Weixiao
Modified: 2008-08-28 02:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (3.88 KB, patch)
2008-06-15 15:44 UTC, Cody Russell
committed Details | Review

Description Weixiao 2008-04-20 02:01:09 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:
Comment 1 Cody Russell 2008-04-20 03:39:00 UTC
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.
Comment 2 Weixiao 2008-04-20 03:49:11 UTC
I am using latest GTK+ 2.12.9 and still get this issue. Do you mean the fix will go in next GTK+ release?
Comment 3 Cody Russell 2008-04-20 14:40:58 UTC
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).
Comment 4 Tor Lillqvist 2008-04-21 07:20:52 UTC
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?
Comment 5 Cody Russell 2008-04-22 04:43:25 UTC
You're right.. debugging now.
Comment 6 Cody Russell 2008-06-15 14:13:11 UTC
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.
Comment 7 Cody Russell 2008-06-15 15:44:02 UTC
Created attachment 112784 [details] [review]
Patch

Need to test this against some of the transient/modal window tests still.
Comment 8 Tor Lillqvist 2008-08-26 18:05:54 UTC
*** Bug 549475 has been marked as a duplicate of this bug. ***
Comment 9 Cody Russell 2008-08-28 02:42:32 UTC
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)
Comment 10 Cody Russell 2008-08-28 02:43:56 UTC
Also merged into gtk-2-12 branch.