Re: [dwm] Master window width in pixels, not percent?

From: Ville Koskinen <>
Date: Mon, 28 Aug 2006 13:48:01 +0300 (EEST)

> In my eyes you don't need to introduce those defines, if you
> know that MASTERW is a percent value, you can do:
> #define MASTERW ((<PIXEL> * 100) / sw)
> replacing <PIXEL> with the pixels you want to supply.

Now that's a neat solution. I don't know how GCC optimizes that, though,
i.e. if it notices that 100 and sw cancel themselves out in the final
expression. If it doesn't, the end result might be inaccurate, as we are
dealing with integer math... Okay, losing or gaining a couple of pixels
due to rounding is not a big deal, as this isn't a nuclear power plant
simulation. :)

I'll hack along and try to figure out a better way to accomplish the
80-character terminals.

Ville Koskinen
Received on Mon Aug 28 2006 - 12:48:32 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:30:37 UTC