From 4b2c46ada2f4da00a788c7996c8f4c89f08cd283 Mon Sep 17 00:00:00 2001 From: Tadeo Kondrak Date: Tue, 26 Jan 2021 13:47:54 -0700 Subject: [PATCH] Fix incorrect damage being applied on popups To reproduce: - Open a floating window and a popup that hangs over the bottom or right - Move the window in the direction of the popup overhang - The previous position of the popup is damaged, not the new one --- sway/desktop/transaction.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c index eac389917..7725fec77 100644 --- a/sway/desktop/transaction.c +++ b/sway/desktop/transaction.c @@ -238,19 +238,6 @@ static void apply_container_state(struct sway_container *container, } } - // Damage the new location - desktop_damage_whole_container(container); - if (view && view->surface) { - struct wlr_surface *surface = view->surface; - struct wlr_box box = { - .x = container->current.content_x - view->geometry.x, - .y = container->current.content_y - view->geometry.y, - .width = surface->current.width, - .height = surface->current.height, - }; - desktop_damage_box(&box); - } - // If the view hasn't responded to the configure, center it within // the container. This is important for fullscreen views which // refuse to resize to the size of the output. @@ -269,6 +256,19 @@ static void apply_container_state(struct sway_container *container, } } + // Damage the new location + desktop_damage_whole_container(container); + if (view && view->surface) { + struct wlr_surface *surface = view->surface; + struct wlr_box box = { + .x = container->current.content_x - view->geometry.x, + .y = container->current.content_y - view->geometry.y, + .width = surface->current.width, + .height = surface->current.height, + }; + desktop_damage_box(&box); + } + if (!container->node.destroying) { container_discover_outputs(container); }