[PATCH] Make shell movement actions methods on a shell surface

Casey Dahlin cdahlin at redhat.com
Thu Jun 9 18:52:17 PDT 2011


This patch makes move and resize methods on a surface rather than methods
stored in some "shell" global. However, to compartmentalize functionality, the
methods still appear in a different interface than wl_surface. The interface is
called wl_shell_surface. The client essentially "casts" a wl_surface to a
wl_shell_surface by constructing a new wl_shell_surface from a wl_surface. The
result is two object IDs with two interfaces, but representing the same
underlying conceptual object.
---
 protocol/wayland.xml |   26 +++++++++++++++-----------
 1 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/protocol/wayland.xml b/protocol/wayland.xml
index 9d0a539..36a2d74 100644
--- a/protocol/wayland.xml
+++ b/protocol/wayland.xml
@@ -142,8 +142,22 @@
   </interface>
 
   <interface name="wl_shell" version="1">
+    <request name="create_drag">
+      <arg name="id" type="new_id" interface="wl_drag"/>
+    </request>
+
+    <request name="create_selection">
+      <arg name="id" type="new_id" interface="wl_selection"/>
+    </request>
+
+    <request name="create_shell_surface">
+      <arg name="id" type="new_id" interface="wl_shell_surface"/>
+      <arg name="surface_id" type="object" interface="wl_surface"/>
+    </request>
+  </interface>
+
+  <interface name="wl_shell_surface" version="1">
     <request name="move">
-      <arg name="surface" type="object" interface="wl_surface"/>
       <arg name="input_device" type="object" interface="wl_input_device"/>
       <arg name="time" type="uint"/>
     </request>
@@ -161,21 +175,12 @@
     </enum>
 
     <request name="resize">
-      <arg name="surface" type="object" interface="wl_surface"/>
       <arg name="input_device" type="object" interface="wl_input_device"/>
       <arg name="time" type="uint"/>
       <!-- edges is an enum, need to get the values in here -->
       <arg name="edges" type="uint"/>
     </request>
 
-    <request name="create_drag">
-      <arg name="id" type="new_id" interface="wl_drag"/>
-    </request>
-
-    <request name="create_selection">
-      <arg name="id" type="new_id" interface="wl_selection"/>
-    </request>
-
     <!-- The configure event asks the client to resize its surface.
          The size is a hint, in the sense that the client is free to
          ignore it if it doesn't resize, pick a smaller size (to
@@ -185,7 +190,6 @@
     <event name="configure">
       <arg name="time" type="uint"/>
       <arg name="edges" type="uint"/>
-      <arg name="surface" type="object" interface="wl_surface"/>
       <arg name="width" type="int"/>
       <arg name="height" type="int"/>
     </event>
-- 
1.7.5.2



More information about the wayland-devel mailing list