From 8b5c572a4624ba955e6cc489fed5cdec8add48e6 Mon Sep 17 00:00:00 2001 From: ortango <8408464+ortango@users.noreply.github.com> Date: Wed, 27 Mar 2024 19:00:56 -0400 Subject: [PATCH] Add border_width to window coordinates Normalize the geometry between reparenting and non- window managers. --- source/xcb.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/xcb.c b/source/xcb.c index ecbddbf24..c43ac2148 100644 --- a/source/xcb.c +++ b/source/xcb.c @@ -890,8 +890,13 @@ static int monitor_active_from_id_focused(int mon_id, workarea *mon) { // place the menu above the window // if some window is focused, place menu above window, else fall // back to selected monitor. - mon->x = t->dst_x - r->x + r->border_width; - mon->y = t->dst_y - r->y + r->border_width; + if (tree_reply->parent == r->root) { + mon->x = t->dst_x - r->x + r->border_width; + mon->y = t->dst_y - r->y + r->border_width; + } else { + mon->x = t->dst_x; + mon->y = t->dst_y; + } mon->w = r->width; mon->h = r->height; retv = TRUE;