[dwm] 3.8: incnmaster bugfix

From: Johannes Klauser <J.Klauser_AT_gmx.net>
Date: Thu, 22 Mar 2007 20:23:19 +0100

Hi,

I fixed a small bug in incnmaster: there was no check if nmaster matches
the maximal number of clients of the current tag.
No it behaves better, but it fails partially if tags have different number
of clients. The only way to fix it completely is the combination with
dfenze's 'Layout per tag - patch' (but I didn't test it).

Here is it:

diff -r 2dec35ad6703 layout.c
--- a/layout.c Mon Mar 05 11:54:59 2007 +0100
+++ b/layout.c Thu Mar 22 20:05:15 2007 +0100
@@ -135,13 +135,15 @@ incmasterw(const char *arg) {

  void
  incnmaster(const char *arg) {
- int i;
+ int i, n;
+ Client *c;

     if(!arg)
         nmaster = NMASTER;
     else {
         i = atoi(arg);
- if((lt->arrange != tile) || (nmaster + i < 1)
+ for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next),
++n);
+ if((n < nmaster + i || lt->arrange != tile) || (nmaster + i < 1)
         || (wah / (nmaster + i) <= 2 * BORDERPX))
             return;
         nmaster += i;

Greetings
Johannes

-- 
- Manche Menschen haben einen Gesichtkreis vom Radius Null und nennen ihn  
ihren Standpunkt -
David Hilbert (1862-1943)
Received on Thu Mar 22 2007 - 20:23:51 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:40:00 UTC