mirror of
https://github.com/swaywm/sway.git
synced 2024-12-29 00:16:22 +01:00
Damage output when a fullscreen view unmaps
Also moved the arranging into view_unmap to avoid excessive code duplication.
This commit is contained in:
parent
beacd4d9f9
commit
7a922c65aa
5 changed files with 15 additions and 17 deletions
|
@ -245,10 +245,7 @@ void view_destroy(struct sway_view *view);
|
|||
|
||||
void view_map(struct sway_view *view, struct wlr_surface *wlr_surface);
|
||||
|
||||
/**
|
||||
* Unmap the view and return the surviving parent (after reaping).
|
||||
*/
|
||||
struct sway_container *view_unmap(struct sway_view *view);
|
||||
void view_unmap(struct sway_view *view);
|
||||
|
||||
void view_update_position(struct sway_view *view, double lx, double ly);
|
||||
|
||||
|
|
|
@ -197,8 +197,7 @@ static void handle_unmap(struct wl_listener *listener, void *data) {
|
|||
return;
|
||||
}
|
||||
|
||||
struct sway_container *parent = view_unmap(view);
|
||||
arrange_and_commit(parent);
|
||||
view_unmap(view);
|
||||
|
||||
wl_list_remove(&xdg_shell_view->commit.link);
|
||||
wl_list_remove(&xdg_shell_view->new_popup.link);
|
||||
|
|
|
@ -196,8 +196,7 @@ static void handle_unmap(struct wl_listener *listener, void *data) {
|
|||
return;
|
||||
}
|
||||
|
||||
struct sway_container *parent = view_unmap(view);
|
||||
arrange_and_commit(parent);
|
||||
view_unmap(view);
|
||||
|
||||
wl_list_remove(&xdg_shell_v6_view->commit.link);
|
||||
wl_list_remove(&xdg_shell_v6_view->new_popup.link);
|
||||
|
|
|
@ -260,8 +260,7 @@ static void handle_unmap(struct wl_listener *listener, void *data) {
|
|||
return;
|
||||
}
|
||||
|
||||
struct sway_container *parent = view_unmap(view);
|
||||
arrange_and_commit(parent);
|
||||
view_unmap(view);
|
||||
|
||||
wl_list_remove(&xwayland_view->commit.link);
|
||||
view->surface = NULL;
|
||||
|
@ -297,9 +296,7 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
|
|||
struct sway_view *view = &xwayland_view->view;
|
||||
|
||||
if (view->surface) {
|
||||
struct sway_container *parent = view_unmap(view);
|
||||
arrange_and_commit(parent);
|
||||
|
||||
view_unmap(view);
|
||||
wl_list_remove(&xwayland_view->commit.link);
|
||||
view->surface = NULL;
|
||||
}
|
||||
|
|
|
@ -539,7 +539,7 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface) {
|
|||
view_handle_container_reparent(&view->container_reparent, NULL);
|
||||
}
|
||||
|
||||
struct sway_container *view_unmap(struct sway_view *view) {
|
||||
void view_unmap(struct sway_view *view) {
|
||||
wl_signal_emit(&view->events.unmap, view);
|
||||
|
||||
wl_list_remove(&view->surface_new_subsurface.link);
|
||||
|
@ -549,10 +549,16 @@ struct sway_container *view_unmap(struct sway_view *view) {
|
|||
struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
|
||||
ws->sway_workspace->fullscreen = NULL;
|
||||
container_destroy(view->swayc);
|
||||
return ws;
|
||||
}
|
||||
|
||||
return container_destroy(view->swayc);
|
||||
struct sway_container *output = ws->parent;
|
||||
struct sway_transaction *transaction = transaction_create();
|
||||
arrange_windows(output, transaction);
|
||||
transaction_add_damage(transaction, container_get_box(output));
|
||||
transaction_commit(transaction);
|
||||
} else {
|
||||
struct sway_container *parent = container_destroy(view->swayc);
|
||||
arrange_and_commit(parent);
|
||||
}
|
||||
}
|
||||
|
||||
void view_update_position(struct sway_view *view, double lx, double ly) {
|
||||
|
|
Loading…
Reference in a new issue