From b56cf3a7ea0a38d070893ae818e8593a3f2427f2 Mon Sep 17 00:00:00 2001 From: Tuyen Pham Date: Sat, 17 Jul 2021 11:48:38 +0000 Subject: [PATCH] correct patch --- sway/desktop/transaction.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c index b1f3fb326..6c4bd80ec 100644 --- a/sway/desktop/transaction.c +++ b/sway/desktop/transaction.c @@ -231,6 +231,13 @@ static void apply_workspace_state(struct sway_workspace *ws, static void apply_container_state(struct sway_container *container, struct sway_container_state *state) { + int tw = 0, th = 0; + struct wlr_texture *texture = config->border_textures.focused.texture; + if (texture) { + tw = texture->width; + th = texture->height; + } + struct sway_view *view = container->view; // Damage the old location desktop_damage_whole_container(container); @@ -238,10 +245,10 @@ static void apply_container_state(struct sway_container *container, struct sway_saved_buffer *saved_buf; wl_list_for_each(saved_buf, &view->saved_buffers, link) { struct wlr_box box = { - .x = saved_buf->x - view->saved_geometry.x, - .y = saved_buf->y - view->saved_geometry.y, - .width = saved_buf->width, - .height = saved_buf->height, + .x = saved_buf->x - view->saved_geometry.x - tw, + .y = saved_buf->y - view->saved_geometry.y - th, + .width = saved_buf->width + 2 * tw, + .height = saved_buf->height + 2 * th, }; desktop_damage_box(&box); } @@ -274,10 +281,10 @@ static void apply_container_state(struct sway_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, + .x = container->current.content_x - view->geometry.x - tw, + .y = container->current.content_y - view->geometry.y - th, + .width = surface->current.width + 2 * tw, + .height = surface->current.height + 2 * th, }; desktop_damage_box(&box); }