|
|
@ -35,6 +35,7 @@ static void popup_handle_destroy(struct wl_listener *listener, void *data) {
|
|
|
|
wl_list_remove(&popup->new_popup.link);
|
|
|
|
wl_list_remove(&popup->new_popup.link);
|
|
|
|
wl_list_remove(&popup->destroy.link);
|
|
|
|
wl_list_remove(&popup->destroy.link);
|
|
|
|
wl_list_remove(&popup->surface_commit.link);
|
|
|
|
wl_list_remove(&popup->surface_commit.link);
|
|
|
|
|
|
|
|
wl_list_remove(&popup->reposition.link);
|
|
|
|
wlr_scene_node_destroy(&popup->scene_tree->node);
|
|
|
|
wlr_scene_node_destroy(&popup->scene_tree->node);
|
|
|
|
free(popup);
|
|
|
|
free(popup);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -70,6 +71,11 @@ static void popup_handle_surface_commit(struct wl_listener *listener, void *data
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void popup_handle_reposition(struct wl_listener *listener, void *data) {
|
|
|
|
|
|
|
|
struct sway_xdg_popup *popup = wl_container_of(listener, popup, reposition);
|
|
|
|
|
|
|
|
popup_unconstrain(popup);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static struct sway_xdg_popup *popup_create(struct wlr_xdg_popup *wlr_popup,
|
|
|
|
static struct sway_xdg_popup *popup_create(struct wlr_xdg_popup *wlr_popup,
|
|
|
|
struct sway_view *view, struct wlr_scene_tree *parent) {
|
|
|
|
struct sway_view *view, struct wlr_scene_tree *parent) {
|
|
|
|
struct wlr_xdg_surface *xdg_surface = wlr_popup->base;
|
|
|
|
struct wlr_xdg_surface *xdg_surface = wlr_popup->base;
|
|
|
@ -116,6 +122,8 @@ static struct sway_xdg_popup *popup_create(struct wlr_xdg_popup *wlr_popup,
|
|
|
|
popup->surface_commit.notify = popup_handle_surface_commit;
|
|
|
|
popup->surface_commit.notify = popup_handle_surface_commit;
|
|
|
|
wl_signal_add(&xdg_surface->events.new_popup, &popup->new_popup);
|
|
|
|
wl_signal_add(&xdg_surface->events.new_popup, &popup->new_popup);
|
|
|
|
popup->new_popup.notify = popup_handle_new_popup;
|
|
|
|
popup->new_popup.notify = popup_handle_new_popup;
|
|
|
|
|
|
|
|
wl_signal_add(&wlr_popup->events.reposition, &popup->reposition);
|
|
|
|
|
|
|
|
popup->reposition.notify = popup_handle_reposition;
|
|
|
|
wl_signal_add(&wlr_popup->events.destroy, &popup->destroy);
|
|
|
|
wl_signal_add(&wlr_popup->events.destroy, &popup->destroy);
|
|
|
|
popup->destroy.notify = popup_handle_destroy;
|
|
|
|
popup->destroy.notify = popup_handle_destroy;
|
|
|
|
|
|
|
|
|
|
|
|