[dwm] 2 bugs in resize()

From: Peter Hartlich <sgkkr_AT_hartlich.com>
Date: Wed, 20 Aug 2008 13:52:27 +0200

Hi again,

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.)

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.

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

Regards,
Peter

Received on Wed Aug 20 2008 - 11:52:27 UTC

This archive was generated by hypermail 2.2.0 : Wed Aug 20 2008 - 12:00:04 UTC