Re: [dwm] Feature request for changing master window's height.

2007-06-15 Thread James Turner
On Sat, Jun 16, 2007 at 04:50:45AM +0200, Engin Tola wrote:
> James Turner <[EMAIL PROTECTED]> writes:
> 
> > On Sat, Jun 16, 2007 at 04:06:44AM +0200, Engin Tola wrote:
> >>
> >> Can you tell at which places it fail ?
> >> I just recently *manually* patched it. Maybe I can assist.
> >>
> >> > Does anybody know if there is an updated patch for bottomstack?  It
> >> > fails it two places while patching.  Thanks.
> >> >
> > Sure, below is the output of running patch -p1 inside my dwm-4.2 dir.
> >
> > Hmm...  Looks like a unified diff to me...
> > The text leading up to this was:
> > --
> > |--- /usr/local/src/dwm/dwm-4.1-virgin/layout.c 2007-05-21
> > 20:59:45.0 -0400
> > |+++ layout.c   2007-05-22 16:06:19.0 -0400
> > --
> > Patching file layout.c using Plan A...
> > Hunk #1 failed at 14.
> > Hunk #2 failed at 38.
> > Hunk #3 succeeded at 81 (offset 12 lines).
> > Hunk #4 succeeded at 194 (offset -4 lines).
> > Hunk #5 succeeded at 232 (offset 12 lines).
> > Hunk #6 failed at 341.
> > 3 out of 6 hunks failed--saving rejects to layout.c.rej
> > Hmm...  The next patch looks like a unified diff to me...
> > The text leading up to this was:
> > --
> > |--- /usr/local/src/dwm/dwm-4.1-virgin/config.default.h 2007-05-21
> > 20:59:45.0 -0400
> > |+++ config.default.h   2007-05-21 21:33:42.0 -0400
> > --
> > Patching file config.default.h using Plan A...
> > Hunk #1 succeeded at 29 (offset -2 lines).
> > done
> 
> this is pretty much illegible with only line numbers. I suggest you to
> open the diff file and layout.c. It is pretty much easy to follow the
> diff file and make the necessary changes. I also attach my own layout.c 
> so that you can adapt yours appropriately. (if you haven't edited your
> layout file before, then you should have this layout in the end actually.)
> 

While running dwm with the bstackportrait(TTT) layout, there is a small
gap between the master and the other windows.  This gap is only present
in the bstackportrait(TTT) layout and not in any of the default layouts
or those added by the bottomstack patch.  Does anyone have a fix? 

-- 
James Turner
BSD Group Consulting
http://www.bsdgroup.org



Re: [dwm] Feature request for changing master window's height.

2007-06-15 Thread James Turner
On Sat, Jun 16, 2007 at 04:50:45AM +0200, Engin Tola wrote:
> James Turner <[EMAIL PROTECTED]> writes:
> 
> > On Sat, Jun 16, 2007 at 04:06:44AM +0200, Engin Tola wrote:
> >>
> >> Can you tell at which places it fail ?
> >> I just recently *manually* patched it. Maybe I can assist.
> >>
> >> > Does anybody know if there is an updated patch for bottomstack?  It
> >> > fails it two places while patching.  Thanks.
> >> >
> > Sure, below is the output of running patch -p1 inside my dwm-4.2 dir.
> >
> > Hmm...  Looks like a unified diff to me...
> > The text leading up to this was:
> > --
> > |--- /usr/local/src/dwm/dwm-4.1-virgin/layout.c 2007-05-21
> > 20:59:45.0 -0400
> > |+++ layout.c   2007-05-22 16:06:19.0 -0400
> > --
> > Patching file layout.c using Plan A...
> > Hunk #1 failed at 14.
> > Hunk #2 failed at 38.
> > Hunk #3 succeeded at 81 (offset 12 lines).
> > Hunk #4 succeeded at 194 (offset -4 lines).
> > Hunk #5 succeeded at 232 (offset 12 lines).
> > Hunk #6 failed at 341.
> > 3 out of 6 hunks failed--saving rejects to layout.c.rej
> > Hmm...  The next patch looks like a unified diff to me...
> > The text leading up to this was:
> > --
> > |--- /usr/local/src/dwm/dwm-4.1-virgin/config.default.h 2007-05-21
> > 20:59:45.0 -0400
> > |+++ config.default.h   2007-05-21 21:33:42.0 -0400
> > --
> > Patching file config.default.h using Plan A...
> > Hunk #1 succeeded at 29 (offset -2 lines).
> > done
> 
> this is pretty much illegible with only line numbers. I suggest you to
> open the diff file and layout.c. It is pretty much easy to follow the
> diff file and make the necessary changes. I also attach my own layout.c 
> so that you can adapt yours appropriately. (if you haven't edited your
> layout file before, then you should have this layout in the end actually.)

Thanks for attaching your layout.c.  Sorry the provided output wasn't
any help.  I will just patch it by hand, I was really just curious if
the patch was still being maintained.

-- 
James Turner
BSD Group Consulting
http://www.bsdgroup.org



Re: [dwm] Feature request for changing master window's height.

2007-06-15 Thread Engin Tola
James Turner <[EMAIL PROTECTED]> writes:

> On Sat, Jun 16, 2007 at 04:06:44AM +0200, Engin Tola wrote:
>>
>> Can you tell at which places it fail ?
>> I just recently *manually* patched it. Maybe I can assist.
>>
>> > Does anybody know if there is an updated patch for bottomstack?  It
>> > fails it two places while patching.  Thanks.
>> >
> Sure, below is the output of running patch -p1 inside my dwm-4.2 dir.
>
> Hmm...  Looks like a unified diff to me...
> The text leading up to this was:
> --
> |--- /usr/local/src/dwm/dwm-4.1-virgin/layout.c 2007-05-21
> 20:59:45.0 -0400
> |+++ layout.c   2007-05-22 16:06:19.0 -0400
> --
> Patching file layout.c using Plan A...
> Hunk #1 failed at 14.
> Hunk #2 failed at 38.
> Hunk #3 succeeded at 81 (offset 12 lines).
> Hunk #4 succeeded at 194 (offset -4 lines).
> Hunk #5 succeeded at 232 (offset 12 lines).
> Hunk #6 failed at 341.
> 3 out of 6 hunks failed--saving rejects to layout.c.rej
> Hmm...  The next patch looks like a unified diff to me...
> The text leading up to this was:
> --
> |--- /usr/local/src/dwm/dwm-4.1-virgin/config.default.h 2007-05-21
> 20:59:45.0 -0400
> |+++ config.default.h   2007-05-21 21:33:42.0 -0400
> --
> Patching file config.default.h using Plan A...
> Hunk #1 succeeded at 29 (offset -2 lines).
> done

this is pretty much illegible with only line numbers. I suggest you to
open the diff file and layout.c. It is pretty much easy to follow the
diff file and make the necessary changes. I also attach my own layout.c 
so that you can adapt yours appropriately. (if you haven't edited your
layout file before, then you should have this layout in the end actually.)

/* See LICENSE file for copyright and license details. */
#include "dwm.h"
#include 

unsigned int blw = 0;
Layout *lt = NULL;

/* static */

static unsigned int nlayouts = 0;
static unsigned int masterw = MASTERWIDTH;
static unsigned int nmaster = NMASTER;

static void
ban(Client *c) {
	if (c->isbanned)
		return;
	XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
	c->isbanned = True;
}

static void
unban(Client *c) {
	if (!c->isbanned)
		return;
	XMoveWindow(dpy, c->win, c->x, c->y);
	c->isbanned = False;
}

static void
_tile(const Bool right) {
	unsigned int i, n, nx, ny, nw, nh, mw, mh, tw, th;
	Client *c;

	for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
		n++;
	/* window geoms */
	mh = (n > nmaster) ? wah / nmaster : wah / (n > 0 ? n : 1);
	mw = (n > nmaster) ? (waw * masterw) / 1000 : waw;
	th = (n > nmaster) ? wah / (n - nmaster) : 0;
	tw = waw - mw;

	for(i = 0, c = clients; c; c = c->next)
		if(isvisible(c)) {
			unban(c);
			if(c->isfloating)
continue;
			c->ismax = False;
			nx = wax;
			ny = way;
			if(i < nmaster) {
   if( !right )
  nx+= tw;
   ny += i * mh;
   nw = mw - 2 * c->border;
   nh = mh;
   if(i + 1 == (n < nmaster ? n : nmaster)) /* remainder */
  nh = wah - mh * i;
   nh -= 2 * c->border;
			}
			else {  /* tile window */
nx += mw;
nw = tw - 2 * c->border;
if(th > 2 * c->border) {
	ny += (i - nmaster) * th;
	nh = th;
	if(i + 1 == n) /* remainder */
		nh = wah - th * (i - nmaster);
	nh -= 2 * c->border;
}
else /* fallback if th <= 2 * c->border */
	nh = wah - 2 * c->border;
			}
			resize(c, nx, ny, nw, nh, False);
			i++;
		}
		else
			ban(c);
	focus(NULL);
	restack();
}

static void
_bstack(const Bool portrait) {
	unsigned int i, n, nx, ny, nw, nh, mw, mh, tw, th;
	Client *c;

	for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
		n++;
	/* window geoms */
	mh = (n > nmaster) ? ((wah * masterw) / 1000) / nmaster : wah / (n > 0 ? n : 1);
	mw = waw;
	th = (n > nmaster) ? ((wah * (1000 - masterw)) / 1000) / (portrait ? 1 : n - nmaster) : 0;
	tw = (n > nmaster) ? waw / (portrait ? n - nmaster : 1) : 0;

	for(i = 0, c = clients; c; c = c->next)
		if(isvisible(c)) {
			if(c->isbanned)
XMoveWindow(dpy, c->win, c->x, c->y);
			c->isbanned = False;
			if(c->isfloating)
continue;
			c->ismax = False;
			nx = wax;
			ny = way;
			if(i < nmaster) {
ny += i * mh;
nw = mw - 2 * c->border;
nh = mh - 2 * c->border;
			}
			else if(portrait) { /* portrait bstack tiles */
nx += (i - nmaster) * tw;
ny += wah - th;
nw = tw - 2 * c->border;
nh = th - 2 * c->border;
			} else { /* landscape bstack tiles */
ny += mh * nmaster;
nw = tw - 2 * c->border;
if(th > 2 * c->border) {
	ny += (i - nmaster) * th;
	nh = th - 2 * c->border;
	if (i == n - 1)
		nh += (n > nmaster) ? wah - mh - th * (n - nmaster) : 0;
}
else /* fallback if th <= 2 * c->border */
	nh = wah - 2 * c->border;
			}
			resize(c, nx, ny, nw, nh, False);
			i++

Re: [dwm] Feature request for changing master window's height.

2007-06-15 Thread James Turner
On Sat, Jun 16, 2007 at 04:06:44AM +0200, Engin Tola wrote:
> 
> Can you tell at which places it fail ? 
> I just recently *manually* patched it. Maybe I can assist.
> 
> 
> James Turner <[EMAIL PROTECTED]> writes:
> 
> > Does anybody know if there is an updated patch for bottomstack?  It
> > fails it two places while patching.  Thanks.
> >
> > --
> > James Turner
> > BSD Group Consulting
> > http://www.bsdgroup.org
> >
> 
> -- 
> engin tola - http://cvlab.epfl.ch/~tola/
> emacs  - http://www.gnu.org/software/emacs/tour/

Sure, below is the output of running patch -p1 inside my dwm-4.2 dir.

Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--
|--- /usr/local/src/dwm/dwm-4.1-virgin/layout.c 2007-05-21
20:59:45.0 -0400
|+++ layout.c   2007-05-22 16:06:19.0 -0400
--
Patching file layout.c using Plan A...
Hunk #1 failed at 14.
Hunk #2 failed at 38.
Hunk #3 succeeded at 81 (offset 12 lines).
Hunk #4 succeeded at 194 (offset -4 lines).
Hunk #5 succeeded at 232 (offset 12 lines).
Hunk #6 failed at 341.
3 out of 6 hunks failed--saving rejects to layout.c.rej
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--
|--- /usr/local/src/dwm/dwm-4.1-virgin/config.default.h 2007-05-21
20:59:45.0 -0400
|+++ config.default.h   2007-05-21 21:33:42.0 -0400
--
Patching file config.default.h using Plan A...
Hunk #1 succeeded at 29 (offset -2 lines).
done

-- 
James Turner
BSD Group Consulting
http://www.bsdgroup.org



Re: [dwm] Feature request for changing master window's height.

2007-06-15 Thread Engin Tola

Can you tell at which places it fail ? 
I just recently *manually* patched it. Maybe I can assist.


James Turner <[EMAIL PROTECTED]> writes:

> Does anybody know if there is an updated patch for bottomstack?  It
> fails it two places while patching.  Thanks.
>
> --
> James Turner
> BSD Group Consulting
> http://www.bsdgroup.org
>

-- 
engin tola - http://cvlab.epfl.ch/~tola/
emacs  - http://www.gnu.org/software/emacs/tour/



Re: [dwm] Feature request for changing master window's height.

2007-06-15 Thread James Turner
Does anybody know if there is an updated patch for bottomstack?  It
fails it two places while patching.  Thanks.

-- 
James Turner
BSD Group Consulting
http://www.bsdgroup.org



Re: [dwm] Feature request for changing master window's height.

2007-06-15 Thread anhnmncb
* Szabolcs Nagy <[EMAIL PROTECTED]> [2007-06-16 02:01:31 +0200]:

> On 6/16/07, anhnmncb <[EMAIL PROTECTED]> wrote:
> >Hi, list:
> >Sadly I don't have a wide-screen LCD, so I have to set the number of
> 
> have a look at bottom stack patch
> http://www.suckless.org/wiki/dwm/patches/bottom_stack

Thanks for your reply, will it be incorpotated in dwm in future?

-- 
[EMAIL PROTECTED]




Re: [dwm] Feature request for changing master window's height.

2007-06-15 Thread Szabolcs Nagy

On 6/16/07, anhnmncb <[EMAIL PROTECTED]> wrote:

Hi, list:
Sadly I don't have a wide-screen LCD, so I have to set the number of


have a look at bottom stack patch
http://www.suckless.org/wiki/dwm/patches/bottom_stack



[dwm] Feature request for changing master window's height.

2007-06-15 Thread anhnmncb
Hi, list:
Sadly I don't have a wide-screen LCD, so I have to set the number of
master to 2, so  tilded windows can be easy for looking and using.

But the problem is, in this mode, two master windows have the same
height, sometimes I want a window narrower, another wider, but I can't
find dwm can do it, dwm can only change the master window's width.

For non-wide-screen users, can dwm add this function of changing
window's height? Thanks.

cheers,
-- 
[EMAIL PROTECTED]