quartz: ensure window being (un)fullscreened is visible

Patch by Paul Davis; part of bug 669808.
(cherry picked from commit 62f1d871b7)
This commit is contained in:
Kristian Rietveld 2012-12-28 21:04:09 +01:00 committed by Michael Natterer
parent c1e0317824
commit 5162751f6c

View File

@ -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);
}
}