diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-06-26 13:15:45 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-06-26 13:15:45 +1000 |
commit | 7a922c65aab27c5f4282cf15de52d240e5ac8052 (patch) | |
tree | bea2a3dee07631b1da05428b29ec5d1e4c47d871 | |
parent | Rename progress_queue to transaction_progress_queue (diff) | |
download | sway-7a922c65aab27c5f4282cf15de52d240e5ac8052.tar.gz sway-7a922c65aab27c5f4282cf15de52d240e5ac8052.tar.zst sway-7a922c65aab27c5f4282cf15de52d240e5ac8052.zip |
Damage output when a fullscreen view unmaps
Also moved the arranging into view_unmap to avoid excessive code
duplication.
-rw-r--r-- | include/sway/tree/view.h | 5 | ||||
-rw-r--r-- | sway/desktop/xdg_shell.c | 3 | ||||
-rw-r--r-- | sway/desktop/xdg_shell_v6.c | 3 | ||||
-rw-r--r-- | sway/desktop/xwayland.c | 7 | ||||
-rw-r--r-- | sway/tree/view.c | 14 |
5 files changed, 15 insertions, 17 deletions
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index 5a615b43..0e6f5292 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h | |||
@@ -245,10 +245,7 @@ void view_destroy(struct sway_view *view); | |||
245 | 245 | ||
246 | void view_map(struct sway_view *view, struct wlr_surface *wlr_surface); | 246 | void view_map(struct sway_view *view, struct wlr_surface *wlr_surface); |
247 | 247 | ||
248 | /** | 248 | void view_unmap(struct sway_view *view); |
249 | * Unmap the view and return the surviving parent (after reaping). | ||
250 | */ | ||
251 | struct sway_container *view_unmap(struct sway_view *view); | ||
252 | 249 | ||
253 | void view_update_position(struct sway_view *view, double lx, double ly); | 250 | void view_update_position(struct sway_view *view, double lx, double ly); |
254 | 251 | ||
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c index ab35b98f..a06c3bd2 100644 --- a/sway/desktop/xdg_shell.c +++ b/sway/desktop/xdg_shell.c | |||
@@ -197,8 +197,7 @@ static void handle_unmap(struct wl_listener *listener, void *data) { | |||
197 | return; | 197 | return; |
198 | } | 198 | } |
199 | 199 | ||
200 | struct sway_container *parent = view_unmap(view); | 200 | view_unmap(view); |
201 | arrange_and_commit(parent); | ||
202 | 201 | ||
203 | wl_list_remove(&xdg_shell_view->commit.link); | 202 | wl_list_remove(&xdg_shell_view->commit.link); |
204 | wl_list_remove(&xdg_shell_view->new_popup.link); | 203 | wl_list_remove(&xdg_shell_view->new_popup.link); |
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c index 76c1fa24..424bca7b 100644 --- a/sway/desktop/xdg_shell_v6.c +++ b/sway/desktop/xdg_shell_v6.c | |||
@@ -196,8 +196,7 @@ static void handle_unmap(struct wl_listener *listener, void *data) { | |||
196 | return; | 196 | return; |
197 | } | 197 | } |
198 | 198 | ||
199 | struct sway_container *parent = view_unmap(view); | 199 | view_unmap(view); |
200 | arrange_and_commit(parent); | ||
201 | 200 | ||
202 | wl_list_remove(&xdg_shell_v6_view->commit.link); | 201 | wl_list_remove(&xdg_shell_v6_view->commit.link); |
203 | wl_list_remove(&xdg_shell_v6_view->new_popup.link); | 202 | wl_list_remove(&xdg_shell_v6_view->new_popup.link); |
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index 7e78ef32..53fa42cc 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c | |||
@@ -260,8 +260,7 @@ static void handle_unmap(struct wl_listener *listener, void *data) { | |||
260 | return; | 260 | return; |
261 | } | 261 | } |
262 | 262 | ||
263 | struct sway_container *parent = view_unmap(view); | 263 | view_unmap(view); |
264 | arrange_and_commit(parent); | ||
265 | 264 | ||
266 | wl_list_remove(&xwayland_view->commit.link); | 265 | wl_list_remove(&xwayland_view->commit.link); |
267 | view->surface = NULL; | 266 | view->surface = NULL; |
@@ -297,9 +296,7 @@ static void handle_destroy(struct wl_listener *listener, void *data) { | |||
297 | struct sway_view *view = &xwayland_view->view; | 296 | struct sway_view *view = &xwayland_view->view; |
298 | 297 | ||
299 | if (view->surface) { | 298 | if (view->surface) { |
300 | struct sway_container *parent = view_unmap(view); | 299 | view_unmap(view); |
301 | arrange_and_commit(parent); | ||
302 | |||
303 | wl_list_remove(&xwayland_view->commit.link); | 300 | wl_list_remove(&xwayland_view->commit.link); |
304 | view->surface = NULL; | 301 | view->surface = NULL; |
305 | } | 302 | } |
diff --git a/sway/tree/view.c b/sway/tree/view.c index 2ca0dbbb..5a78112a 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -539,7 +539,7 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface) { | |||
539 | view_handle_container_reparent(&view->container_reparent, NULL); | 539 | view_handle_container_reparent(&view->container_reparent, NULL); |
540 | } | 540 | } |
541 | 541 | ||
542 | struct sway_container *view_unmap(struct sway_view *view) { | 542 | void view_unmap(struct sway_view *view) { |
543 | wl_signal_emit(&view->events.unmap, view); | 543 | wl_signal_emit(&view->events.unmap, view); |
544 | 544 | ||
545 | wl_list_remove(&view->surface_new_subsurface.link); | 545 | wl_list_remove(&view->surface_new_subsurface.link); |
@@ -549,10 +549,16 @@ struct sway_container *view_unmap(struct sway_view *view) { | |||
549 | struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE); | 549 | struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE); |
550 | ws->sway_workspace->fullscreen = NULL; | 550 | ws->sway_workspace->fullscreen = NULL; |
551 | container_destroy(view->swayc); | 551 | container_destroy(view->swayc); |
552 | return ws; | ||
553 | } | ||
554 | 552 | ||
555 | return container_destroy(view->swayc); | 553 | struct sway_container *output = ws->parent; |
554 | struct sway_transaction *transaction = transaction_create(); | ||
555 | arrange_windows(output, transaction); | ||
556 | transaction_add_damage(transaction, container_get_box(output)); | ||
557 | transaction_commit(transaction); | ||
558 | } else { | ||
559 | struct sway_container *parent = container_destroy(view->swayc); | ||
560 | arrange_and_commit(parent); | ||
561 | } | ||
556 | } | 562 | } |
557 | 563 | ||
558 | void view_update_position(struct sway_view *view, double lx, double ly) { | 564 | void view_update_position(struct sway_view *view, double lx, double ly) { |