From 5162751f6c10dc65dac595d513a11f03c897b7f9 Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Fri, 28 Dec 2012 21:04:09 +0100 Subject: [PATCH] quartz: ensure window being (un)fullscreened is visible Patch by Paul Davis; part of bug 669808. (cherry picked from commit 62f1d871b70a8e08b899942827386d6f3222c986) --- gdk/quartz/gdkwindow-quartz.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c index b1bcc483f9..106a46b076 100644 --- a/gdk/quartz/gdkwindow-quartz.c +++ b/gdk/quartz/gdkwindow-quartz.c @@ -2840,6 +2840,7 @@ static void gdk_quartz_window_fullscreen (GdkWindow *window) { FullscreenSavedGeometry *geometry; + GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); NSRect frame; if (GDK_WINDOW_DESTROYED (window) || @@ -2865,10 +2866,14 @@ gdk_quartz_window_fullscreen (GdkWindow *window) gdk_window_set_decorations (window, 0); - frame = [[NSScreen mainScreen] frame]; + frame = [[impl->toplevel screen] frame]; move_resize_window_internal (window, 0, 0, frame.size.width, frame.size.height); + [impl->toplevel setContentSize:frame.size]; + [impl->toplevel makeKeyAndOrderFront:impl->toplevel]; + + clear_toplevel_order (); } SetSystemUIMode (kUIModeAllHidden, kUIOptionAutoShowMenuBar); @@ -2879,6 +2884,7 @@ gdk_quartz_window_fullscreen (GdkWindow *window) static void gdk_quartz_window_unfullscreen (GdkWindow *window) { + GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); FullscreenSavedGeometry *geometry; if (GDK_WINDOW_DESTROYED (window) || @@ -2900,6 +2906,9 @@ gdk_quartz_window_unfullscreen (GdkWindow *window) g_object_set_data (G_OBJECT (window), FULLSCREEN_DATA, NULL); + [impl->toplevel makeKeyAndOrderFront:impl->toplevel]; + clear_toplevel_order (); + gdk_synthesize_window_state (window, GDK_WINDOW_STATE_FULLSCREEN, 0); } }