Skip to content

Commit 60d41fb

Browse files
committed
xdg_shell: handle xdg_popup reposition signal
We are advertising xdg-shell v4, but forgot to handle this signal.
1 parent 119f98f commit 60d41fb

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

xdg_shell.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ popup_handle_destroy(struct wl_listener *listener, void *data)
293293
struct cg_xdg_popup *popup = wl_container_of(listener, popup, destroy);
294294
wl_list_remove(&popup->destroy.link);
295295
wl_list_remove(&popup->commit.link);
296+
wl_list_remove(&popup->reposition.link);
296297
free(popup);
297298
}
298299

@@ -306,6 +307,14 @@ popup_handle_commit(struct wl_listener *listener, void *data)
306307
}
307308
}
308309

310+
static void
311+
popup_handle_reposition(struct wl_listener *listener, void *data)
312+
{
313+
struct cg_xdg_popup *popup = wl_container_of(listener, popup, reposition);
314+
315+
popup_unconstrain(popup->xdg_popup);
316+
}
317+
309318
void
310319
handle_new_xdg_popup(struct wl_listener *listener, void *data)
311320
{
@@ -350,6 +359,9 @@ handle_new_xdg_popup(struct wl_listener *listener, void *data)
350359
popup->commit.notify = popup_handle_commit;
351360
wl_signal_add(&wlr_popup->base->surface->events.commit, &popup->commit);
352361

362+
popup->reposition.notify = popup_handle_reposition;
363+
wl_signal_add(&wlr_popup->events.reposition, &popup->reposition);
364+
353365
struct wlr_scene_tree *popup_scene_tree = wlr_scene_xdg_surface_create(parent_scene_tree, wlr_popup->base);
354366
if (popup_scene_tree == NULL) {
355367
wlr_log(WLR_ERROR, "Failed to allocate scene-graph node for XDG popup");

xdg_shell.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ struct cg_xdg_popup {
3131

3232
struct wl_listener destroy;
3333
struct wl_listener commit;
34+
struct wl_listener reposition;
3435
};
3536

3637
void handle_new_xdg_toplevel(struct wl_listener *listener, void *data);

0 commit comments

Comments
 (0)