diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-04-23 18:21:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-23 18:21:51 +0200 |
commit | c0831344aae7f103a077c836abbd5c9553c6ae95 (patch) | |
tree | 36ee8a1e11e05198ab18739cbb9ebb2d665e1424 /examples/layer-shell.c | |
parent | e2ed7be0baa6fe17d6a4a73c68ac1e8b6dea96f9 (diff) | |
parent | 67a10cc1f68c4f8e7b78b1a5b06aceafb4f3f7ca (diff) |
Merge pull request #891 from agx/layer-shell-popup-grab
examples/layer-shell: take grab on the popup
Diffstat (limited to 'examples/layer-shell.c')
-rw-r--r-- | examples/layer-shell.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/layer-shell.c b/examples/layer-shell.c index 0e1d61ca..d9deb7b0 100644 --- a/examples/layer-shell.c +++ b/examples/layer-shell.c @@ -209,7 +209,7 @@ static const struct xdg_popup_listener xdg_popup_listener = { .popup_done = xdg_popup_done, }; -static void create_popup() { +static void create_popup(uint32_t serial) { if (popup) { return; } @@ -227,6 +227,8 @@ static void create_popup() { xdg_positioner_set_anchor(xdg_positioner, XDG_POSITIONER_ANCHOR_BOTTOM_RIGHT); popup = xdg_surface_get_popup(xdg_surface, NULL, xdg_positioner); + xdg_popup_grab(popup, seat, serial); + assert(popup); zwlr_layer_surface_v1_get_popup(layer_surface, popup); @@ -311,7 +313,7 @@ static void wl_pointer_button(void *data, struct wl_pointer *wl_pointer, if (popup_wl_surface) { popup_destroy(); } else { - create_popup(); + create_popup(serial); } } else { buttons++; |