[PATCH weston 7/8] shell: export shell_surface internal field via shell_interface

Tiago Vignatti tiago.vignatti at intel.com
Mon May 7 05:23:13 PDT 2012


xserver submodule lacks visibility on shell_surface internals. In order to get
shell_surface->weston_surface->geometries for the commit coming next, this is
being introduced. It's a hack really.

Another solution could be xserver access directly shell, but both are loaded
modules without symbols being shared.

We probably need shell_surface on global scope soon.

Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>
---
 src/compositor.h |    2 ++
 src/shell.c      |    8 ++++++++
 2 files changed, 10 insertions(+)

diff --git a/src/compositor.h b/src/compositor.h
index 3722d32..f258066 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -57,6 +57,8 @@ struct weston_mode {
 struct weston_shell_interface {
 	void *shell;			/* either desktop or tablet */
 
+	void (*get_surface)(struct shell_surface *shsurf,
+			struct weston_surface **surface);
 	void (*create_shell_surface)(void *shell,
 				     struct weston_surface *surface,
 				     struct shell_surface **ret);
diff --git a/src/shell.c b/src/shell.c
index 1fc627d..b30e2d9 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -1231,6 +1231,13 @@ get_shell_surface(struct weston_surface *surface)
 	return NULL;
 }
 
+/* XXX: this is here because we don't have shell_surface on global scope */
+static void
+get_surface(struct shell_surface *shsurf, struct weston_surface **surface)
+{
+	*surface = shsurf->surface;
+}
+
 static void
 shell_surface_configure(struct weston_surface *, int32_t, int32_t);
 
@@ -2592,6 +2599,7 @@ shell_init(struct weston_compositor *ec)
 	shell->unlock_listener.notify = unlock;
 	wl_signal_add(&ec->unlock_signal, &shell->unlock_listener);
 	ec->ping_handler = ping_handler;
+	ec->shell_interface.get_surface = get_surface;
 	ec->shell_interface.create_shell_surface = create_shell_surface;
 	ec->shell_interface.set_toplevel = set_toplevel;
 
-- 
1.7.9.5



More information about the wayland-devel mailing list