From abc1979c04423ebd23a5651bfeafddddd790cc09 Mon Sep 17 00:00:00 2001 From: Zedhugh Chen Date: Sat, 20 Dec 2025 12:50:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20monocle=20=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E5=9C=A8=E7=AA=97=E5=8F=A3=E8=BE=B9=E6=A1=86=E5=AE=BD?= =?UTF-8?q?=E5=BA=A6=E4=B8=8D=E4=B8=BA=200=20=E6=97=B6=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E4=B8=8D=E5=AF=B9=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/layout.c b/src/layout.c index 5769caf..4bc85f6 100644 --- a/src/layout.c +++ b/src/layout.c @@ -2,6 +2,7 @@ #include +#include "base.h" #include "client.h" #include "types.h" #include "utils.h" @@ -10,10 +11,17 @@ void monocle(tag_t *tag) { logger("== monocle tag: %s start ==\n", tag->name); for (task_in_tag_t *task = tag->task_list; task; task = task->next) { if (!client_need_layout(task->client)) continue; - task->geometry = task->client->monitor->workarea; - logger("== window 0x%x: x: %d, y: %d, width: %u, height: %u\n", - task->client->window, task->geometry.x, task->geometry.y, - task->geometry.width, task->geometry.height); + + uint16_t border_width = task->client->border_width; + area_t workarea = task->client->monitor->workarea; + task->geometry.x = workarea.x; + task->geometry.y = workarea.y; + task->geometry.width = workarea.width - border_width * 2; + task->geometry.height = workarea.height - border_width * 2; + logger( + "== window 0x%x: x: %d, y: %d, width: %u, height: %u, border width: %u\n", + task->client->window, task->geometry.x, task->geometry.y, + task->geometry.width, task->geometry.height, border_width); } logger("== monocle tag: %s end ==\n", tag->name); }