quartz: ensure window being (un)fullscreened is visible

Patch by Paul Davis; part of bug 669808.
This commit is contained in:
Kristian Rietveld 2012-12-28 21:04:09 +01:00
parent 1f0f399469
commit 62f1d871b7

View File

@ -2921,6 +2921,7 @@ gdk_window_fullscreen (GdkWindow *window)
{ {
FullscreenSavedGeometry *geometry; FullscreenSavedGeometry *geometry;
GdkWindowObject *private = (GdkWindowObject *) window; GdkWindowObject *private = (GdkWindowObject *) window;
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
NSRect frame; NSRect frame;
if (GDK_WINDOW_DESTROYED (window) || if (GDK_WINDOW_DESTROYED (window) ||
@ -2946,10 +2947,14 @@ gdk_window_fullscreen (GdkWindow *window)
gdk_window_set_decorations (window, 0); gdk_window_set_decorations (window, 0);
frame = [[NSScreen mainScreen] frame]; frame = [[impl->toplevel screen] frame];
move_resize_window_internal (window, move_resize_window_internal (window,
0, 0, 0, 0,
frame.size.width, frame.size.height); frame.size.width, frame.size.height);
[impl->toplevel setContentSize:frame.size];
[impl->toplevel makeKeyAndOrderFront:impl->toplevel];
clear_toplevel_order ();
} }
SetSystemUIMode (kUIModeAllHidden, kUIOptionAutoShowMenuBar); SetSystemUIMode (kUIModeAllHidden, kUIOptionAutoShowMenuBar);
@ -2960,6 +2965,8 @@ gdk_window_fullscreen (GdkWindow *window)
void void
gdk_window_unfullscreen (GdkWindow *window) gdk_window_unfullscreen (GdkWindow *window)
{ {
GdkWindowObject *private = (GdkWindowObject *) window;
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
FullscreenSavedGeometry *geometry; FullscreenSavedGeometry *geometry;
if (GDK_WINDOW_DESTROYED (window) || if (GDK_WINDOW_DESTROYED (window) ||
@ -2981,6 +2988,9 @@ gdk_window_unfullscreen (GdkWindow *window)
g_object_set_data (G_OBJECT (window), FULLSCREEN_DATA, NULL); 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); gdk_synthesize_window_state (window, GDK_WINDOW_STATE_FULLSCREEN, 0);
} }
} }