summaryrefslogtreecommitdiff
path: root/src/wayland/meta-wayland-popup.c
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2015-02-12 11:20:52 +0800
committerJonas Ådahl <jadahl@gmail.com>2015-02-17 22:14:47 +0800
commit9a99a80710921105f1c316b4da0eafda04a720b9 (patch)
treeb526b315b5f376c023c1f6bb88574f6fcec471e8 /src/wayland/meta-wayland-popup.c
parentbe77874ec92dd7ff936955ac89ce67db5edc2a08 (diff)
downloadmutter-9a99a80710921105f1c316b4da0eafda04a720b9.tar.gz
wayland: Fail clients who try to create or destroy a not-top-most popup
If a client creates an xdg_popup given a parent that is a xdg_popup that is not the most top one in the grab chain, send the not_the_topmost_popup error. Also fail a client who destroys a popup that is not the top most one. https://bugzilla.gnome.org/show_bug.cgi?id=744452
Diffstat (limited to 'src/wayland/meta-wayland-popup.c')
-rw-r--r--src/wayland/meta-wayland-popup.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/wayland/meta-wayland-popup.c b/src/wayland/meta-wayland-popup.c
index cc8b4bd8d..f3d47aef7 100644
--- a/src/wayland/meta-wayland-popup.c
+++ b/src/wayland/meta-wayland-popup.c
@@ -172,6 +172,17 @@ meta_wayland_popup_grab_end (MetaWaylandPopupGrab *grab)
meta_wayland_pointer_end_grab (grab->generic.pointer);
}
+MetaWaylandSurface *
+meta_wayland_popup_grab_get_top_popup (MetaWaylandPopupGrab *grab)
+{
+ MetaWaylandPopup *popup;
+
+ g_assert (!wl_list_empty (&grab->all_popups));
+ popup = wl_container_of (grab->all_popups.next, popup, link);
+
+ return popup->surface;
+}
+
gboolean
meta_wayland_pointer_grab_is_popup_grab (MetaWaylandPointerGrab *grab)
{
@@ -199,6 +210,12 @@ meta_wayland_popup_dismiss (MetaWaylandPopup *popup)
meta_wayland_pointer_end_popup_grab (popup_grab->generic.pointer);
}
+MetaWaylandSurface *
+meta_wayland_popup_get_top_popup (MetaWaylandPopup *popup)
+{
+ return meta_wayland_popup_grab_get_top_popup (popup->grab);
+}
+
struct wl_signal *
meta_wayland_popup_get_destroy_signal (MetaWaylandPopup *popup)
{