[gtk+/gtk-2-24-quartz] win32: Send window-state-changes before configure events
- From: John Ralls <jralls src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-24-quartz] win32: Send window-state-changes before configure events
- Date: Wed, 23 Nov 2011 22:59:37 +0000 (UTC)
commit e051917b982c4c30b015b54f7e80afdb45742937
Author: Alexander Larsson <alexl redhat com>
Date: Wed Oct 26 10:21:10 2011 +0200
win32: Send window-state-changes before configure events
This is requires to that the state of the window is right when
you get the configure event (and to match what X does).
Fixes bug #169811
gdk/win32/gdkevents-win32.c | 60 +++++++++++++++++++++---------------------
gdk/win32/gdkwindow-win32.c | 8 +++--
2 files changed, 35 insertions(+), 33 deletions(-)
---
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index 860f252..383543c 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -2932,36 +2932,6 @@ gdk_event_translate (MSG *msg,
_gdk_win32_append_event (event);
}
- /* Show, New size or position => configure event */
- if (!(windowpos->flags & SWP_NOCLIENTMOVE) ||
- !(windowpos->flags & SWP_NOCLIENTSIZE) ||
- (windowpos->flags & SWP_SHOWWINDOW))
- {
- if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD &&
- !IsIconic (msg->hwnd) &&
- !GDK_WINDOW_DESTROYED (window))
- handle_configure_event (msg, window);
-
- if (((GdkWindowObject *) window)->extension_events != 0)
- _gdk_input_configure_event (window);
- }
-
- if ((windowpos->flags & SWP_HIDEWINDOW) &&
- !GDK_WINDOW_DESTROYED (window))
- {
- /* Send UNMAP events */
- event = gdk_event_new (GDK_UNMAP);
- event->any.window = window;
- _gdk_win32_append_event (event);
-
- /* Make transient parent the forground window when window unmaps */
- impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (window)->impl);
-
- if (impl->transient_owner &&
- GetForegroundWindow () == GDK_WINDOW_HWND (window))
- SetForegroundWindow (GDK_WINDOW_HWND (impl->transient_owner));
- }
-
/* Update window state */
if (windowpos->flags & (SWP_STATECHANGED | SWP_SHOWWINDOW | SWP_HIDEWINDOW))
{
@@ -3007,6 +2977,36 @@ gdk_event_translate (MSG *msg,
ensure_stacking_on_unminimize (msg);
}
+ /* Show, New size or position => configure event */
+ if (!(windowpos->flags & SWP_NOCLIENTMOVE) ||
+ !(windowpos->flags & SWP_NOCLIENTSIZE) ||
+ (windowpos->flags & SWP_SHOWWINDOW))
+ {
+ if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD &&
+ !IsIconic (msg->hwnd) &&
+ !GDK_WINDOW_DESTROYED (window))
+ handle_configure_event (msg, window);
+
+ if (((GdkWindowObject *) window)->extension_events != 0)
+ _gdk_input_configure_event (window);
+ }
+
+ if ((windowpos->flags & SWP_HIDEWINDOW) &&
+ !GDK_WINDOW_DESTROYED (window))
+ {
+ /* Send UNMAP events */
+ event = gdk_event_new (GDK_UNMAP);
+ event->any.window = window;
+ _gdk_win32_append_event (event);
+
+ /* Make transient parent the forground window when window unmaps */
+ impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (window)->impl);
+
+ if (impl->transient_owner &&
+ GetForegroundWindow () == GDK_WINDOW_HWND (window))
+ SetForegroundWindow (GDK_WINDOW_HWND (impl->transient_owner));
+ }
+
if (!(windowpos->flags & SWP_NOCLIENTSIZE))
{
if (((GdkWindowObject *) window)->resize_count > 1)
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index fc3adb5..2031e57 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -3378,14 +3378,15 @@ gdk_window_fullscreen (GdkWindow *window)
g_object_set_data (G_OBJECT (window), "fullscreen-info", fi);
fi->style = GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE);
+ /* Send state change before configure event */
+ gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FULLSCREEN);
+
SetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE,
(fi->style & ~WS_OVERLAPPEDWINDOW) | WS_POPUP);
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_TOP,
x, y, width, height,
SWP_NOCOPYBITS | SWP_SHOWWINDOW));
-
- gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FULLSCREEN);
}
}
@@ -3402,6 +3403,8 @@ gdk_window_unfullscreen (GdkWindow *window)
{
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (private->impl);
+ gdk_synthesize_window_state (window, GDK_WINDOW_STATE_FULLSCREEN, 0);
+
impl->hint_flags = fi->hint_flags;
SetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE, fi->style);
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_NOTOPMOST,
@@ -3412,7 +3415,6 @@ gdk_window_unfullscreen (GdkWindow *window)
g_object_set_data (G_OBJECT (window), "fullscreen-info", NULL);
g_free (fi);
- gdk_synthesize_window_state (window, GDK_WINDOW_STATE_FULLSCREEN, 0);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]