[hackers] [dwm] applied Donald Chai's showhide patch in slightly modified ways || Anselm R Garbe

From: <hg_AT_suckless.org>
Date: Sat, 6 Sep 2008 08:21:38 +0000 (UTC)

changeset: 1355:9172f2200001
tag: tip
user: Anselm R Garbe <garbeam_AT_gmail.com>
date: Sat Sep 06 09:21:32 2008 +0100
files: dwm.c
description:
applied Donald Chai's showhide patch in slightly modified ways

diff -r dced80b409d8 -r 9172f2200001 dwm.c
--- a/dwm.c Sat Sep 06 08:59:51 2008 +0100
+++ b/dwm.c Sat Sep 06 09:21:32 2008 +0100
@@ -180,6 +180,7 @@
 static void setlayout(const Arg *arg);
 static void setmfact(const Arg *arg);
 static void setup(void);
+static void showhide(Client *c);
 static void spawn(const Arg *arg);
 static void tag(const Arg *arg);
 static int textnw(const char *text, unsigned int len);
@@ -271,18 +272,8 @@
 
 void
 arrange(void) {
- Client *c;
-
- for(c = clients; c; c = c->next)
- if(ISVISIBLE(c)) {
- XMoveWindow(dpy, c->win, c->x, c->y);
- if(!lt[sellt]->arrange || c->isfloating)
- resize(c, c->x, c->y, c->w, c->h, True);
- }
- else {
- XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
- }
-
+ if(stack)
+ showhide(stack);
         focus(NULL);
         if(lt[sellt]->arrange)
                 lt[sellt]->arrange();
@@ -1377,6 +1368,19 @@
 }
 
 void
+showhide(Client *c) {
+ if(ISVISIBLE(c)) { /* show clients top down */
+ XMoveWindow(dpy, c->win, c->x, c->y);
+ if(!lt[sellt]->arrange || c->isfloating)
+ resize(c, c->x, c->y, c->w, c->h, True);
+ }
+ if(c->snext) /* hide clients bottom up */
+ showhide(c->snext);
+ if(!ISVISIBLE(c))
+ XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
+}
+
+void
 spawn(const Arg *arg) {
         /* The double-fork construct avoids zombie processes and keeps the code
          * clean from stupid signal handlers. */
Received on Sat Sep 06 2008 - 08:21:38 UTC

This archive was generated by hypermail 2.2.0 : Sat Sep 06 2008 - 08:24:05 UTC