summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2015-02-27 23:18:00 +0000
committerMatthias Clasen <mclasen@redhat.com>2015-02-27 19:09:03 -0500
commita0eb0e23468c7516fa7809f22a8bcaf165915c1a (patch)
tree04f3020f05ea3bcd6ba86b71da69c390b42c9470 /gdk
parent3d205a20374f344681989261e7a18135c05a0c5f (diff)
downloadgtk+-a0eb0e23468c7516fa7809f22a8bcaf165915c1a.tar.gz
wayland: Apply maximized and fullscreen state
We were just throwing the request away if the app asks to fullscreen or maximize a window before it has been mapped. This is something the GdkWindow API explicitly supports, so make it work by saving the state until the surface exists. This fixes things under weston. There are bugs in mutter that keep this from working correctly with gnome-shell. https://bugzilla.gnome.org/show_bug.cgi?id=745303
Diffstat (limited to 'gdk')
-rw-r--r--gdk/wayland/gdkwindow-wayland.c38
1 files changed, 22 insertions, 16 deletions
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 8a449ff488..cc0d3b4c99 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -953,6 +953,12 @@ gdk_wayland_window_create_xdg_surface (GdkWindow *window)
gdk_wayland_window_sync_parent (window);
gdk_wayland_window_sync_title (window);
gdk_wayland_window_sync_margin (window);
+
+ if (window->state & GDK_WINDOW_STATE_MAXIMIZED)
+ xdg_surface_set_maximized (impl->xdg_surface);
+ if (window->state & GDK_WINDOW_STATE_FULLSCREEN)
+ xdg_surface_set_fullscreen (impl->xdg_surface, NULL);
+
xdg_surface_set_app_id (impl->xdg_surface, gdk_get_program_class ());
}
@@ -1757,10 +1763,10 @@ gdk_wayland_window_maximize (GdkWindow *window)
if (GDK_WINDOW_DESTROYED (window))
return;
- if (!impl->xdg_surface)
- return;
-
- xdg_surface_set_maximized (impl->xdg_surface);
+ if (impl->xdg_surface)
+ xdg_surface_set_maximized (impl->xdg_surface);
+ else
+ gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_MAXIMIZED);
}
static void
@@ -1771,10 +1777,10 @@ gdk_wayland_window_unmaximize (GdkWindow *window)
if (GDK_WINDOW_DESTROYED (window))
return;
- if (!impl->xdg_surface)
- return;
-
- xdg_surface_unset_maximized (impl->xdg_surface);
+ if (impl->xdg_surface)
+ xdg_surface_unset_maximized (impl->xdg_surface);
+ else
+ gdk_synthesize_window_state (window, GDK_WINDOW_STATE_MAXIMIZED, 0);
}
static void
@@ -1785,10 +1791,10 @@ gdk_wayland_window_fullscreen (GdkWindow *window)
if (GDK_WINDOW_DESTROYED (window))
return;
- if (!impl->xdg_surface)
- return;
-
- xdg_surface_set_fullscreen (impl->xdg_surface, NULL);
+ if (impl->xdg_surface)
+ xdg_surface_set_fullscreen (impl->xdg_surface, NULL);
+ else
+ gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FULLSCREEN);
}
static void
@@ -1799,10 +1805,10 @@ gdk_wayland_window_unfullscreen (GdkWindow *window)
if (GDK_WINDOW_DESTROYED (window))
return;
- if (!impl->xdg_surface)
- return;
-
- xdg_surface_unset_fullscreen (impl->xdg_surface);
+ if (impl->xdg_surface)
+ xdg_surface_unset_fullscreen (impl->xdg_surface);
+ else
+ gdk_synthesize_window_state (window, GDK_WINDOW_STATE_FULLSCREEN, 0);
}
static void