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); }