summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStein <bakkeby@gmail.com>2022-08-09 10:38:08 +0200
committerrafa_99 <raroma09@gmail.com>2022-08-11 08:50:38 +0100
commitfb4fa465788edd5833ab6f1f0c04148910aafbef (patch)
treef9d40b46feeed637170663c7a4eda31cd1bf559f
parentec40b333a148b33e4e025bd1951b0ad16433553f (diff)
Simplify client y-offset correction
The reasoning behind the original line may be lost to time as it does not make much sense checking the position on the x-axis to determine how to position the client on the y-axis. In the context of multi-monitor setups the monitor y position (m->my) may be greater than 0 (say 500), in which case the window could be placed out of view if: - the window attributes have a 0 value for the y position and - we end up using the y position of bh (e.g. 22) If the aim is to avoid a new floating client covering the bar then restricting y position to be at least that of the window area (m->wy) should cover the two cases of using a top bar and using a bottom bar.
-rw-r--r--dwm.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/dwm.c b/dwm.c
index da65028..d5ded17 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1141,9 +1141,7 @@ manage(Window w, XWindowAttributes *wa)
if (c->y + HEIGHT(c) > c->mon->my + c->mon->mh)
c->y = c->mon->my + c->mon->mh - HEIGHT(c);
c->x = MAX(c->x, c->mon->mx);
- /* only fix client y-offset, if the client center might cover the bar */
- c->y = MAX(c->y, ((c->mon->by == c->mon->my) && (c->x + (c->w / 2) >= c->mon->wx)
- && (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? bh : c->mon->my);
+ c->y = MAX(c->y, c->mon->wy);
c->bw = borderpx;
wc.border_width = c->bw;