[dev] dwm: attach above patch

2009-07-05 Thread Mate Nagy
Hi all,
 this is a patch against current hg that attaches new clients above the
current focused client, as opposed to as master every time. (This is how
xmonad behaves).

Regards,
 Mate
diff -r 4fff5050c835 dwm.c
--- a/dwm.c	Thu Jul 02 20:56:23 2009 +0100
+++ b/dwm.c	Sun Jul 05 15:54:30 2009 +0200
@@ -151,6 +151,7 @@
 static Bool applysizehints(Client *c, int *x, int *y, int *w, int *h, Bool interact);
 static void arrange(void);
 static void attach(Client *c);
+static void attachabove(Client *c);
 static void attachstack(Client *c);
 static void buttonpress(XEvent *e);
 static void checkotherwm(void);
@@ -389,6 +390,19 @@
 }
 
 void
+attachabove(Client *c) {
+	if(c->mon->sel == NULL || c->mon->sel == c->mon->clients || c->mon->sel->isfloating) {
+		attach(c);
+		return;
+	}
+
+	Client *at;
+	for (at = c->mon->clients; at->next != c->mon->sel; at = at->next);
+	c->next = at->next;
+	at->next = c;
+}
+
+void
 attachstack(Client *c) {
 	c->snext = c->mon->stack;
 	c->mon->stack = c;
@@ -1094,7 +1108,7 @@
 		c->isfloating = trans != None || c->isfixed;
 	if(c->isfloating)
 		XRaiseWindow(dpy, c->win);
-	attach(c);
+	attachabove(c);
 	attachstack(c);
 	XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */
 	XMapWindow(dpy, c->win);


[dev] dwm in a window

2009-07-05 Thread Alexander Polakov
Hi all

 Something like this was requested by some people here and there who
are not comfortable with running a tiling window manager for all the
windows.

 Well, explaining is not my best (and english too), so better take a
look at a picture
 http://rootshell.be/~polachok/trash/dwm-in-a-win.png

 Or get the code here (I wonder why didn't I put the diff) and try it yourself
 http://rootshell.be/~polachok/code/dwm-5.5.tar.gz



Re: [dev] dwm in a window

2009-07-05 Thread Mate Nagy
Yo,
>  Something like this was requested by some people here and there who
> are not comfortable with running a tiling window manager for all the
> windows.
 how is this different from Xephyr/Xnest?

Regards,
 Mate



Re: [dev] dwm in a window

2009-07-05 Thread Samuel Baldwin
What's wrong with using floating mode for some windows?

-- 
Samuel 'Shardz' Baldwin - staticfree.info/~samuel



Re: [dev] dwm in a window

2009-07-05 Thread Uriel
How is it different from rio[1]?

Oh, wait, forgot that X is over thirty years behind on window system
technology[2].

uriel

[1] http://man.cat-v.org/plan_9/1/rio
[2] http://doc.cat-v.org/bell_labs/concurrent_window_system/


On Sun, Jul 5, 2009 at 8:52 PM, Mate Nagy wrote:
> Yo,
>>  Something like this was requested by some people here and there who
>> are not comfortable with running a tiling window manager for all the
>> windows.
>  how is this different from Xephyr/Xnest?
>
> Regards,
>  Mate
>
>



Re: [dev] dwm in a window

2009-07-05 Thread Jacob Todd
Yeah. But at least it doesn't look like rio. :)

On Mon, Jul 06, 2009 at 01:30:13AM +0200, Uriel wrote:
> How is it different from rio[1]?
> 
> Oh, wait, forgot that X is over thirty years behind on window system
> technology[2].

-- 
Jake Todd
// If it isn't broke, tweak it!


pgpJoNu4NA254.pgp
Description: PGP signature