forked from AuroraMiddleware/gtk
Check if the window's state has GDK_WINDOW_STATE_MAXIMIZED set before
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) svn path=/trunk/; revision=21218
This commit is contained in:
parent
3f53433008
commit
1c146ec11f
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
||||
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)
|
||||
|
||||
2008-08-27 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkprintoperation.c: Documentation fixes.
|
||||
|
@ -1304,7 +1304,14 @@ show_window_recurse (GdkWindow *window, gboolean hide_window)
|
||||
{
|
||||
if (GDK_WINDOW_OBJECT (window)->state & GDK_WINDOW_STATE_ICONIFIED)
|
||||
{
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
|
||||
if (GDK_WINDOW_OBJECT (window)->state & GDK_WINDOW_STATE_MAXIMIZED)
|
||||
{
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWMAXIMIZED);
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1318,7 +1325,7 @@ show_window_recurse (GdkWindow *window, gboolean hide_window)
|
||||
}
|
||||
|
||||
static void
|
||||
show_window_internal (GdkWindow *window, gboolean hide_window)
|
||||
do_show_window (GdkWindow *window, gboolean hide_window)
|
||||
{
|
||||
GdkWindow *tmp_window = NULL;
|
||||
GdkWindowImplWin32 *tmp_impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (window)->impl);
|
||||
@ -1339,7 +1346,10 @@ show_window_internal (GdkWindow *window, gboolean hide_window)
|
||||
}
|
||||
|
||||
/* Recursively show/hide every window in the chain. */
|
||||
show_window_recurse (tmp_window, hide_window);
|
||||
if (tmp_window != window)
|
||||
{
|
||||
show_window_recurse (tmp_window, hide_window);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2922,7 +2932,7 @@ gdk_event_translate (MSG *msg,
|
||||
{
|
||||
case SC_MINIMIZE:
|
||||
case SC_RESTORE:
|
||||
show_window_internal (window, msg->wParam == SC_MINIMIZE ? TRUE : FALSE);
|
||||
do_show_window (window, msg->wParam == SC_MINIMIZE ? TRUE : FALSE);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -2951,7 +2961,7 @@ gdk_event_translate (MSG *msg,
|
||||
gdk_synthesize_window_state (window,
|
||||
GDK_WINDOW_STATE_WITHDRAWN,
|
||||
GDK_WINDOW_STATE_ICONIFIED);
|
||||
show_window_internal (window, TRUE);
|
||||
do_show_window (window, TRUE);
|
||||
}
|
||||
else if ((msg->wParam == SIZE_RESTORED ||
|
||||
msg->wParam == SIZE_MAXIMIZED) &&
|
||||
@ -2973,7 +2983,7 @@ gdk_event_translate (MSG *msg,
|
||||
|
||||
if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_TEMP && !GDK_WINDOW_IS_MAPPED (window))
|
||||
{
|
||||
show_window_internal (window, FALSE);
|
||||
do_show_window (window, FALSE);
|
||||
}
|
||||
}
|
||||
else if (msg->wParam == SIZE_MAXIMIZED)
|
||||
|
@ -1106,15 +1106,25 @@ show_window_internal (GdkWindow *window,
|
||||
}
|
||||
|
||||
if (private->state & GDK_WINDOW_STATE_FULLSCREEN)
|
||||
gdk_window_fullscreen (window);
|
||||
{
|
||||
gdk_window_fullscreen (window);
|
||||
}
|
||||
else if (private->state & GDK_WINDOW_STATE_MAXIMIZED)
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_MAXIMIZE);
|
||||
{
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_MAXIMIZE);
|
||||
}
|
||||
else if (private->state & GDK_WINDOW_STATE_ICONIFIED)
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
|
||||
{
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
|
||||
}
|
||||
else if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP || !focus_on_map)
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNOACTIVATE);
|
||||
{
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNOACTIVATE);
|
||||
}
|
||||
else
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNORMAL);
|
||||
{
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNORMAL);
|
||||
}
|
||||
|
||||
if (raise)
|
||||
{
|
||||
@ -1126,17 +1136,25 @@ show_window_internal (GdkWindow *window,
|
||||
GDK_WINDOW_TYPE (window) == GDK_WINDOW_DIALOG)
|
||||
{
|
||||
if (focus_on_map && private->accept_focus)
|
||||
SetForegroundWindow (GDK_WINDOW_HWND (window));
|
||||
{
|
||||
SetForegroundWindow (GDK_WINDOW_HWND (window));
|
||||
}
|
||||
else
|
||||
SetWindowPos (GDK_WINDOW_HWND (window), HWND_TOP,
|
||||
0, 0, 0, 0,
|
||||
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
|
||||
{
|
||||
SetWindowPos (GDK_WINDOW_HWND (window), HWND_TOP,
|
||||
0, 0, 0, 0,
|
||||
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
|
||||
}
|
||||
}
|
||||
else
|
||||
BringWindowToTop (GDK_WINDOW_HWND (window));
|
||||
{
|
||||
BringWindowToTop (GDK_WINDOW_HWND (window));
|
||||
}
|
||||
}
|
||||
else if (old_active_window != GDK_WINDOW_HWND (window))
|
||||
SetActiveWindow (old_active_window);
|
||||
{
|
||||
SetActiveWindow (old_active_window);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user