Commit b9d88ac6 authored by Richard Hult's avatar Richard Hult Committed by Richard Hult

Make sure we leave fullscreen mode if the window is hidden.

2008-02-14  Richard Hult  <richard@imendio.com>

	* gdk/quartz/gdkwindow-quartz.c: (get_fullscreen_geometry),
	(gdk_window_hide), (gdk_window_fullscreen),
	(gdk_window_unfullscreen): Make sure we leave fullscreen mode if
	the window is hidden.

svn path=/trunk/; revision=19567
parent 59687608
2008-02-14 Richard Hult <richard@imendio.com>
* gdk/quartz/gdkwindow-quartz.c: (get_fullscreen_geometry),
(gdk_window_hide), (gdk_window_fullscreen),
(gdk_window_unfullscreen): Make sure we leave fullscreen mode if
the window is hidden.
2008-02-14 Richard Hult <richard@imendio.com>
* gdk/quartz/GdkQuartzWindow.c: Set frame, not bounds when
......
......@@ -32,8 +32,20 @@ static guint update_idle;
static GSList *main_window_stack;
#define FULLSCREEN_DATA "fullscreen-data"
typedef struct
{
gint x, y;
gint width, height;
GdkWMDecoration decor;
} FullscreenSavedGeometry;
static void update_toplevel_order (void);
static void clear_toplevel_order (void);
static void clear_toplevel_order (void);
static FullscreenSavedGeometry *get_fullscreen_geometry (GdkWindow *window);
#define WINDOW_IS_TOPLEVEL(window) \
(GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD && \
......@@ -1079,6 +1091,10 @@ gdk_window_hide (GdkWindow *window)
g_return_if_fail (GDK_IS_WINDOW (window));
/* Make sure we're not stuck in fullscreen mode. */
if (get_fullscreen_geometry (window))
ShowMenuBar ();
if (GDK_WINDOW_DESTROYED (window))
return;
......@@ -2711,14 +2727,11 @@ gdk_window_deiconify (GdkWindow *window)
}
}
#define FULLSCREEN_DATA "fullscreen-data"
typedef struct
static FullscreenSavedGeometry *
get_fullscreen_geometry (GdkWindow *window)
{
gint x, y;
gint width, height;
GdkWMDecoration decor;
} FullscreenSavedGeometry;
return g_object_get_data (G_OBJECT (window), FULLSCREEN_DATA);
}
void
gdk_window_fullscreen (GdkWindow *window)
......@@ -2731,28 +2744,32 @@ gdk_window_fullscreen (GdkWindow *window)
g_return_if_fail (GDK_IS_WINDOW (window));
g_return_if_fail (WINDOW_IS_TOPLEVEL (window));
geometry = g_new (FullscreenSavedGeometry, 1);
geometry = get_fullscreen_geometry (window);
if (!geometry)
{
geometry = g_new (FullscreenSavedGeometry, 1);
geometry->x = private->x;
geometry->y = private->y;
geometry->width = impl->width;
geometry->height = impl->height;
geometry->x = private->x;
geometry->y = private->y;
geometry->width = impl->width;
geometry->height = impl->height;
if (!gdk_window_get_decorations (window, &geometry->decor))
geometry->decor = GDK_DECOR_ALL;
if (!gdk_window_get_decorations (window, &geometry->decor))
geometry->decor = GDK_DECOR_ALL;
g_object_set_data_full (G_OBJECT (window),
FULLSCREEN_DATA, geometry,
g_free);
g_object_set_data_full (G_OBJECT (window),
FULLSCREEN_DATA, geometry,
g_free);
HideMenuBar ();
gdk_window_set_decorations (window, 0);
gdk_window_set_decorations (window, 0);
frame = [[NSScreen mainScreen] frame];
move_resize_window_internal (window,
0, 0,
frame.size.width, frame.size.height);
}
frame = [[NSScreen mainScreen] frame];
move_resize_window_internal (window,
0, 0,
frame.size.width, frame.size.height);
HideMenuBar ();
gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FULLSCREEN);
}
......@@ -2765,8 +2782,7 @@ gdk_window_unfullscreen (GdkWindow *window)
g_return_if_fail (GDK_IS_WINDOW (window));
g_return_if_fail (WINDOW_IS_TOPLEVEL (window));
geometry = g_object_get_data (G_OBJECT (window), FULLSCREEN_DATA);
geometry = get_fullscreen_geometry (window);
if (geometry)
{
ShowMenuBar ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment