[mutter] wayland/xdg-shell: Check popup parent type when assigning
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] wayland/xdg-shell: Check popup parent type when assigning
- Date: Thu, 30 Nov 2017 03:00:16 +0000 (UTC)
commit c533a06e93e5eb70aae70900ded384646c4861c7
Author: Jonas Ådahl <jadahl gmail com>
Date: Wed Nov 15 16:03:36 2017 +0800
wayland/xdg-shell: Check popup parent type when assigning
We only allow mapping popups on top of surfaces with a xdg_surface
based role. Add a check and fail clients that doesn't follow this rule.
https://bugzilla.gnome.org/show_bug.cgi?id=790358
src/wayland/meta-wayland-xdg-shell.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c
index 5ca39b3..8bb2ec7 100644
--- a/src/wayland/meta-wayland-xdg-shell.c
+++ b/src/wayland/meta-wayland-xdg-shell.c
@@ -1553,6 +1553,14 @@ xdg_surface_constructor_get_popup (struct wl_client *client,
return;
}
+ if (!META_IS_WAYLAND_XDG_SURFACE (parent_surface->role))
+ {
+ wl_resource_post_error (xdg_shell_resource,
+ ZXDG_SHELL_V6_ERROR_INVALID_POPUP_PARENT,
+ "Invalid popup parent role");
+ return;
+ }
+
xdg_popup = META_WAYLAND_XDG_POPUP (surface->role);
xdg_popup->resource = wl_resource_create (client,
&zxdg_popup_v6_interface,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]