Re: [hackers] [dwm][PATCH] Simplify client y-offset correction

From: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Tue, 9 Aug 2022 23:38:03 +0200

On Tue, Aug 09, 2022 at 10:38:08AM +0200, Stein wrote:
> 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.
> ---
> dwm.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/dwm.c b/dwm.c
> index 967c9e8..87d0ada 100644
> --- a/dwm.c
> +++ b/dwm.c
> _AT_@ -1049,9 +1049,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;
> --
> 2.37.1
>
>

Hi,

Sorry but this commit is much too vague. Doesn't this change the behaviour as
described in the original comment ("client center")?

Please provide a more clear description of the setup you have and the steps to
reproduce them as it would help to understand the problem and the intended
behaviour better.

-- 
Kind regards,
Hiltjo
Received on Tue Aug 09 2022 - 23:38:03 CEST

This archive was generated by hypermail 2.3.0 : Tue Aug 09 2022 - 23:48:35 CEST