[mutter] wayland: add extended state for tiled



commit e7430a45356da043019659db9b4892a08f889c7e
Author: Olivier Fourdan <ofourdan redhat com>
Date:   Wed May 25 15:04:27 2016 +0200

    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 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c
index 240970c..5321467 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]