修复 monocle 布局在窗口边框宽度不为 0 时位置不对 bug
This commit is contained in:
16
src/layout.c
16
src/layout.c
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include "base.h"
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
@@ -10,10 +11,17 @@ void monocle(tag_t *tag) {
|
|||||||
logger("== monocle tag: %s start ==\n", tag->name);
|
logger("== monocle tag: %s start ==\n", tag->name);
|
||||||
for (task_in_tag_t *task = tag->task_list; task; task = task->next) {
|
for (task_in_tag_t *task = tag->task_list; task; task = task->next) {
|
||||||
if (!client_need_layout(task->client)) continue;
|
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",
|
uint16_t border_width = task->client->border_width;
|
||||||
task->client->window, task->geometry.x, task->geometry.y,
|
area_t workarea = task->client->monitor->workarea;
|
||||||
task->geometry.width, task->geometry.height);
|
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);
|
logger("== monocle tag: %s end ==\n", tag->name);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user