Re: [dwm] 2 bugs in resize()

From: Anselm R Garbe <garbeam_AT_gmail.com>
Date: Sat, 23 Aug 2008 09:49:08 +0100

Hi Peter,

2008/8/20 Peter Hartlich <sgkkr_AT_hartlich.com>:
> In resize(), dwm tries to check, with the condition c->mina > (float) h/w,
> if a window's aspect is less than its stated minimum aspect. Since mina
> and h/w are not actually aspects but their reciprocals, the > sign needs
> to be a <. (Try it with mplayer.)

Yes this is a bug. I will apply your portions regarding this.

> Is there a reason though for mina being y/x ratio instead of x/y, maybe
> some tricky floating point accuracy business? If not, I'd suggest changing
> the aspect code along the lines of the patch attached.

The only reason I can imagine is, that y < x usually, so I'd rather
keep this for the mina.

> Another problem is that in case of a window with a min size and no base
> size, basew/baseh is set to the value of minw/minh. Unfortunately, the
> ICCCM (4.1.2.3*, last two sentences) forbids subtracting the min size
> before aspect ratio calculation. This skews calculating the aspect for
> mplayer windows (4x4 min size) a little. I'm not sure how to fix it though
> without turning the code into a mess...
>
> * http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.2.3

Hmm, I might have overlooked this, however I'm rather confident that
most other WMs do it similiarly. I will add a check if minw == basew
&& minh == baseh to prevent the subtraction in this corner case.

Kind regards,
--Anselm
Received on Sat Aug 23 2008 - 08:49:08 UTC

This archive was generated by hypermail 2.2.0 : Sat Aug 23 2008 - 09:00:05 UTC