summaryrefslogtreecommitdiff
path: root/xwayland
diff options
context:
space:
mode:
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>2014-10-01 15:02:41 +0300
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2014-10-08 13:16:30 +0300
commit50b67479033709d8ab32744c7b8346b130ace9e0 (patch)
tree277ea29fd7bec395faf960f8b7796434767dc03e /xwayland
parentd7cd1480d4c75cfdeb28b34202707bfe3595b0ea (diff)
downloadweston-50b67479033709d8ab32744c7b8346b130ace9e0.tar.gz
compositor: send error for surface role resets
With the more accurate definition of wl_surface roles in Wayland, enforce the restriction: a role is always set permanently, and attempting to change it is a protocol error. This patch is based on Jasper's patch: http://lists.freedesktop.org/archives/wayland-devel/2014-August/016811.html The difference in this patch compared to his are: - send role errors on the interface whose request triggers it, not on wl_surface - an interface could have several requests assigning different roles, cannot use wl_interface as the unique key; use an arbitary string instead - ensure in window-manager.c that create_shell_surface() -> create_common_surface() is never called with surface->configure set, to avoid compositor abort - use wl_resource_post_no_memory() where appropriate instead of hand-rolling it with wl_resource_post_error() Ideally we would not add weston_surface::role_name field, but use weston_surface::configure. At the moment this is not possible though, because at least shell.c uses several different roles with the same configure function. Drag'n'drop uses two configure functions for the same role. The configure hook is also reset in several places, which is not good for role tracking. This patch overlooks the wl_surface roles assigned in privileged extensions: screensaver, panel, background, lock, input panel. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Diffstat (limited to 'xwayland')
-rw-r--r--xwayland/window-manager.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c
index 4e91f9dc..29023733 100644
--- a/xwayland/window-manager.c
+++ b/xwayland/window-manager.c
@@ -2303,6 +2303,13 @@ xserver_map_shell_surface(struct weston_wm_window *window,
if (!shell_interface->get_primary_view)
return;
+ if (window->surface->configure) {
+ weston_log("warning, unexpected in %s: "
+ "surface's configure hook is already set.\n",
+ __func__);
+ return;
+ }
+
window->shsurf =
shell_interface->create_shell_surface(shell_interface->shell,
window->surface,