[dwm] addtomwfact -> setmwfact proposal

From: Jukka Salmi <j+dwm_AT_2007.salmi.ch>
Date: Fri, 17 Aug 2007 12:25:28 +0200

Hi,

what about renaming addtomwfact() to setmwfact() and allowing for
mwfact to be set both relatively and abolutely? Sometimes I need a
terminal window which has exactly 80 columns; that's where being able
to set mwfact explicitly would be nice.

The attached patch implements this minor change. The argument passed
to setmwfact() is handled as follows:

- If the first character is either '+' or '-', the value is added
  or subtracted from mwfact. This is the current behaviour of
  addtomwfact(), except that a plus sign is needed to incement mwfact.

- If the first chararcter is neither '+' nor '-', mwfact is set to the
  value, no matter what the current mwfact value is.

Furthermore, for large delta values mwfact currently doesn't come close
to its limits (0.1, 0.9). The patch fixes this as well.

It also prevents arrange() from being called if sscanf() fails
(shouldn't happen, but...).

Comments are welcome!

Cheers, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~

Received on Fri Aug 17 2007 - 12:25:29 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:50:01 UTC