[PATCH weston] compositor-wayland: Respond to ping requests on outputs' shell surfaces

Ander Conselvan de Oliveira ander.conselvan.de.oliveira at intel.com
Mon Jun 18 07:36:21 PDT 2012


Otherwise one can't interact with it because of the busy cursor grab.
---
 src/compositor-wayland.c |   30 +++++++++++++++++++++++++++++-
 1 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c
index d498e84..fc1917d 100644
--- a/src/compositor-wayland.c
+++ b/src/compositor-wayland.c
@@ -367,6 +367,8 @@ wayland_output_destroy(struct weston_output *output_base)
 	return;
 }
 
+static const struct wl_shell_surface_listener shell_surface_listener;
+
 static int
 wayland_compositor_create_output(struct wayland_compositor *c,
 				 int width, int height)
@@ -428,7 +430,8 @@ wayland_compositor_create_output(struct wayland_compositor *c,
 	output->parent.shell_surface =
 		wl_shell_get_shell_surface(c->parent.shell,
 					   output->parent.surface);
-	/* FIXME: add shell_surface listener for resizing */
+	wl_shell_surface_add_listener(output->parent.shell_surface,
+				      &shell_surface_listener, output);
 	wl_shell_surface_set_toplevel(output->parent.shell_surface);
 
 	output->base.origin = output->base.current;
@@ -454,6 +457,31 @@ cleanup_output:
 	return -1;
 }
 
+static void
+shell_surface_ping(void *data, struct wl_shell_surface *shell_surface,
+		   uint32_t serial)
+{
+	wl_shell_surface_pong(shell_surface, serial);
+}
+
+static void
+shell_surface_configure(void *data, struct wl_shell_surface *shell_surface,
+			uint32_t edges, int32_t width, int32_t height)
+{
+	/* FIXME: implement resizing */
+}
+
+static void
+shell_surface_popup_done(void *data, struct wl_shell_surface *shell_surface)
+{
+}
+
+static const struct wl_shell_surface_listener shell_surface_listener = {
+	shell_surface_ping,
+	shell_surface_configure,
+	shell_surface_popup_done
+};
+
 /* Events received from the wayland-server this compositor is client of: */
 
 /* parent output interface */
-- 
1.7.4.1



More information about the wayland-devel mailing list