Re: [dwm] An "overlapped tiled" layout

From: Monsieur Pinocchio <cchinopio_AT_gmail.com>
Date: Mon, 8 Sep 2008 02:50:15 -0400

On Sun, Sep 7, 2008 at 5:06 PM, Tinou <tinoucas_AT_gmail.com> wrote:

> Hello,
>
> I've applied a modified version of your patch to my copy of dwm.
>
> I don't quite understand the need to set stack_mode to 'Above' and then
> 'Below' when reached the selected client (in restack(void)). Actually,
> this alone messes with monocle layout (open a floating window and
> you'll see the n - 1 window is no longer the one beneath the
> new floating window. Once removed, I didn't see a change in
> tileo...
>

Now that you state it, I think I made a mistake. I wanted the stack area
  - to show the selected window fully;
  - to show the top portion of each of the windows above the selected one;
  - to show the bottom portion of each of the windows below the selected
one.
The key was to keep a portion of all windows visible at all time. I think I
confused myself with display order (client list) and focus order (stack
list) in restack() and actually didn't end up achieving that.

Here is an alternative patch on restack() [dwm5.1] which should solve the
above issue. I tried it with monocle without issues.

diff -r 51ab64a3d67f dwm.c
--- a/dwm.c Mon Sep 08 02:08:38 2008 -0400
+++ b/dwm.c Mon Sep 08 02:45:47 2008 -0400
@@ -1196,13 +1196,16 @@
     if(sel->isfloating || !lt[sellt]->arrange)
         XRaiseWindow(dpy, sel->win);
     if(lt[sellt]->arrange) {
- wc.stack_mode = Below;
+ wc.stack_mode = Above;
         wc.sibling = barwin;
- for(c = stack; c; c = c->snext)
- if(!c->isfloating && ISVISIBLE(c)) {
+ for(c = clients; c && ISVISIBLE(c); c = c->next) {
+ if(!c->isfloating) {
                 XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc);
                 wc.sibling = c->win;
             }
+ if(c == sel)
+ wc.stack_mode = Below;
+ }
     }
     XSync(dpy, False);
     while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));

Are there any issues with changing restack this way for other operations?

> Thanks anyway for your patch, I like it :-)
>

Good to know :).

-- 
Pinocchio
Received on Mon Sep 08 2008 - 06:50:15 UTC

This archive was generated by hypermail 2.2.0 : Mon Sep 08 2008 - 07:00:05 UTC