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
This commit is contained in:
Jonas Ådahl
2015-02-12 11:20:52 +08:00
parent be77874ec9
commit 9a99a80710
5 changed files with 56 additions and 0 deletions

View File

@ -741,3 +741,15 @@ meta_wayland_pointer_can_popup (MetaWaylandPointer *pointer, uint32_t serial)
{
return pointer->grab_serial == serial;
}
MetaWaylandSurface *
meta_wayland_pointer_get_top_popup (MetaWaylandPointer *pointer)
{
MetaWaylandPopupGrab *grab;
if (!meta_wayland_pointer_grab_is_popup_grab (pointer->grab))
return NULL;
grab = (MetaWaylandPopupGrab*)pointer->grab;
return meta_wayland_popup_grab_get_top_popup(grab);
}