Skip to content

Commit

Permalink
Merge pull request swaywm#1967 from emersion/remove-xdg-popup-unmap
Browse files Browse the repository at this point in the history
Don't destroy view child on xdg-popup unmap
  • Loading branch information
ddevault authored May 12, 2018
2 parents b1c33ec + 360e63b commit 9d607b7
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 13 deletions.
1 change: 0 additions & 1 deletion include/sway/tree/view.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ struct sway_xdg_popup_v6 {
struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6;

struct wl_listener new_popup;
struct wl_listener unmap;
struct wl_listener destroy;
};

Expand Down
8 changes: 0 additions & 8 deletions sway/desktop/xdg_shell_v6.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ static void popup_destroy(struct sway_view_child *child) {
}
struct sway_xdg_popup_v6 *popup = (struct sway_xdg_popup_v6 *)child;
wl_list_remove(&popup->new_popup.link);
wl_list_remove(&popup->unmap.link);
wl_list_remove(&popup->destroy.link);
free(popup);
}
Expand All @@ -39,11 +38,6 @@ static void popup_handle_new_popup(struct wl_listener *listener, void *data) {
popup_create(wlr_popup, popup->child.view);
}

static void popup_handle_unmap(struct wl_listener *listener, void *data) {
struct sway_xdg_popup_v6 *popup = wl_container_of(listener, popup, unmap);
view_child_destroy(&popup->child);
}

static void popup_handle_destroy(struct wl_listener *listener, void *data) {
struct sway_xdg_popup_v6 *popup = wl_container_of(listener, popup, destroy);
view_child_destroy(&popup->child);
Expand All @@ -62,8 +56,6 @@ static struct sway_xdg_popup_v6 *popup_create(

wl_signal_add(&xdg_surface->events.new_popup, &popup->new_popup);
popup->new_popup.notify = popup_handle_new_popup;
wl_signal_add(&xdg_surface->events.unmap, &popup->unmap);
popup->unmap.notify = popup_handle_unmap;
wl_signal_add(&xdg_surface->events.destroy, &popup->destroy);
popup->destroy.notify = popup_handle_destroy;

Expand Down
4 changes: 0 additions & 4 deletions sway/desktop/xwayland.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ static void unmanaged_handle_unmap(struct wl_listener *listener, void *data) {
static void unmanaged_handle_destroy(struct wl_listener *listener, void *data) {
struct sway_xwayland_unmanaged *surface =
wl_container_of(listener, surface, destroy);
struct wlr_xwayland_surface *xsurface = surface->wlr_xwayland_surface;
if (xsurface->mapped) {
unmanaged_handle_unmap(&surface->unmap, xsurface);
}
wl_list_remove(&surface->map.link);
wl_list_remove(&surface->unmap.link);
wl_list_remove(&surface->destroy.link);
Expand Down

0 comments on commit 9d607b7

Please sign in to comment.