From e7430a45356da043019659db9b4892a08f889c7e Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Wed, 25 May 2016 15:04:27 +0200 Subject: [PATCH] wayland: add extended state for tiled xdg-shell allows desktop environments to extend the list of states within a given range. Use this possibility to add a new state for tiled so that gtk+ can benefit from this. https://bugzilla.gnome.org/show_bug.cgi?id=766860 --- src/wayland/meta-wayland-xdg-shell.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c index 240970c08..5321467a6 100644 --- a/src/wayland/meta-wayland-xdg-shell.c +++ b/src/wayland/meta-wayland-xdg-shell.c @@ -35,6 +35,13 @@ #include "wayland/meta-window-wayland.h" #include "xdg-shell-unstable-v5-server-protocol.h" +/* + * Define GNOME additional states to xdg-shell + * The current reserved range for GNOME is 0x1000 - 0x1FFF + */ + +#define XDG_SURFACE_STATE_GNOME_TILED 0x1000 + struct _MetaWaylandXdgSurface { MetaWaylandSurfaceRoleShellSurface parent; @@ -399,6 +406,13 @@ fill_states (struct wl_array *states, MetaWindow *window) s = wl_array_add (states, sizeof *s); *s = XDG_SURFACE_STATE_ACTIVATED; } + /* GNOME extension to xdg-shell states */ + if (window->tile_mode == META_TILE_LEFT || + window->tile_mode == META_TILE_RIGHT) + { + s = wl_array_add (states, sizeof *s); + *s = XDG_SURFACE_STATE_GNOME_TILED; + } } static void