aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop/xdg_shell_v6.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-04-06 14:17:58 -0400
committeremersion <contact@emersion.fr>2018-04-06 14:17:58 -0400
commit58914822aa70d69a61794c52aa2113dbe7fcc7af (patch)
treeba1de3856366da1883247fe49d463c6ba35b9b57 /sway/desktop/xdg_shell_v6.c
parente550e22c0b6e2192f2750a6e13356980426d26ba (diff)
Don't damage the whole output
Diffstat (limited to 'sway/desktop/xdg_shell_v6.c')
-rw-r--r--sway/desktop/xdg_shell_v6.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c
index b82eec8f..e4703040 100644
--- a/sway/desktop/xdg_shell_v6.c
+++ b/sway/desktop/xdg_shell_v6.c
@@ -143,9 +143,7 @@ static void destroy(struct sway_view *view) {
if (xdg_shell_v6_view == NULL) {
return;
}
- wl_list_remove(&xdg_shell_v6_view->commit.link);
wl_list_remove(&xdg_shell_v6_view->destroy.link);
- wl_list_remove(&xdg_shell_v6_view->new_popup.link);
wl_list_remove(&xdg_shell_v6_view->map.link);
wl_list_remove(&xdg_shell_v6_view->unmap.link);
free(xdg_shell_v6_view);
@@ -182,14 +180,28 @@ static void handle_new_popup(struct wl_listener *listener, void *data) {
static void handle_unmap(struct wl_listener *listener, void *data) {
struct sway_xdg_shell_v6_view *xdg_shell_v6_view =
wl_container_of(listener, xdg_shell_v6_view, unmap);
+
view_unmap(&xdg_shell_v6_view->view);
+
+ wl_list_remove(&xdg_shell_v6_view->commit.link);
+ wl_list_remove(&xdg_shell_v6_view->new_popup.link);
}
static void handle_map(struct wl_listener *listener, void *data) {
struct sway_xdg_shell_v6_view *xdg_shell_v6_view =
wl_container_of(listener, xdg_shell_v6_view, map);
struct sway_view *view = &xdg_shell_v6_view->view;
+ struct wlr_xdg_surface_v6 *xdg_surface = view->wlr_xdg_surface_v6;
+
view_map(view, view->wlr_xdg_surface_v6->surface);
+
+ xdg_shell_v6_view->commit.notify = handle_commit;
+ wl_signal_add(&xdg_surface->surface->events.commit,
+ &xdg_shell_v6_view->commit);
+
+ xdg_shell_v6_view->new_popup.notify = handle_new_popup;
+ wl_signal_add(&xdg_surface->events.new_popup,
+ &xdg_shell_v6_view->new_popup);
}
static void handle_destroy(struct wl_listener *listener, void *data) {
@@ -226,14 +238,6 @@ void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) {
// - Look up pid and open on appropriate workspace
// - Criteria
- xdg_shell_v6_view->commit.notify = handle_commit;
- wl_signal_add(&xdg_surface->surface->events.commit,
- &xdg_shell_v6_view->commit);
-
- xdg_shell_v6_view->new_popup.notify = handle_new_popup;
- wl_signal_add(&xdg_surface->events.new_popup,
- &xdg_shell_v6_view->new_popup);
-
xdg_shell_v6_view->map.notify = handle_map;
wl_signal_add(&xdg_surface->events.map, &xdg_shell_v6_view->map);