[gtk+] wayland: Preserve dimensions separately for fullscreen / maximised case
- From: Rob Bradford <rbradford src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] wayland: Preserve dimensions separately for fullscreen / maximised case
- Date: Tue, 19 Mar 2013 19:55:18 +0000 (UTC)
commit 1b15b9e1bcdafe881cfc0f4e825489c234061c9e
Author: Rob Bradford <rob linux intel com>
Date: Tue Mar 19 19:52:49 2013 +0000
wayland: Preserve dimensions separately for fullscreen / maximised case
Use separate fields for saving the window dimensions prior to fullscreening
and maximisation. Then use those fields to restore the window dimensions from.
gdk/wayland/gdkwindow-wayland.c | 23 ++++++++++++++++-------
1 files changed, 16 insertions(+), 7 deletions(-)
---
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 1973f30..42cce16 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -136,7 +136,10 @@ struct _GdkWindowImplWayland
guint32 grab_time;
gboolean fullscreen;
- int saved_width, saved_height; /* before going fullscreen */
+ struct
+ {
+ int width, height;
+ } saved_fullscreen, saved_maximized;
};
struct _GdkWindowImplWaylandClass
@@ -1307,8 +1310,8 @@ gdk_wayland_window_maximize (GdkWindow *window)
{
if (impl->surface)
{
- impl->saved_width = gdk_window_get_width (window);
- impl->saved_height = gdk_window_get_height (window);
+ impl->saved_maximized.width = gdk_window_get_width (window);
+ impl->saved_maximized.height = gdk_window_get_height (window);
if (impl->shell_surface)
wl_shell_surface_set_maximized (impl->shell_surface, NULL);
@@ -1342,6 +1345,11 @@ gdk_wayland_window_unmaximize (GdkWindow *window)
gdk_synthesize_window_state (window,
GDK_WINDOW_STATE_MAXIMIZED,
0);
+
+ gdk_wayland_window_configure (window,
+ impl->saved_maximized.width,
+ impl->saved_maximized.height,
+ 0);
}
}
@@ -1356,8 +1364,8 @@ gdk_wayland_window_fullscreen (GdkWindow *window)
if (impl->fullscreen)
return;
- impl->saved_width = gdk_window_get_width (window);
- impl->saved_height = gdk_window_get_height (window);
+ impl->saved_fullscreen.width = gdk_window_get_width (window);
+ impl->saved_fullscreen.height = gdk_window_get_height (window);
wl_shell_surface_set_fullscreen (impl->shell_surface,
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
0,
@@ -1381,10 +1389,11 @@ gdk_wayland_window_unfullscreen (GdkWindow *window)
wl_shell_surface_set_toplevel (impl->shell_surface);
gdk_synthesize_window_state (window, GDK_WINDOW_STATE_FULLSCREEN, 0);
- gdk_wayland_window_configure (window, impl->saved_width, impl->saved_height,
+ gdk_wayland_window_configure (window,
+ impl->saved_fullscreen.width,
+ impl->saved_fullscreen.height,
0);
-
impl->fullscreen = FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]