JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
renames swim[ming] into versatile
authorAnselm R. Garbe <arg@suckless.org>
Mon, 19 Feb 2007 16:12:26 +0000 (17:12 +0100)
committerAnselm R. Garbe <arg@suckless.org>
Mon, 19 Feb 2007 16:12:26 +0000 (17:12 +0100)
client.c
config.arg.h
config.default.h
dwm.1
dwm.h
event.c
screen.c

index e312a9a..2aa1955 100644 (file)
--- a/client.c
+++ b/client.c
@@ -253,8 +253,8 @@ manage(Window w, XWindowAttributes *wa) {
        updatetitle(c);
        for(t = clients; t && t->win != trans; t = t->next);
        settags(c, t);
        updatetitle(c);
        for(t = clients; t && t->win != trans; t = t->next);
        settags(c, t);
-       if(!c->swimming)
-               c->swimming = (t != NULL) || c->isfixed;
+       if(!c->versatile)
+               c->versatile = (t != NULL) || c->isfixed;
        attach(c);
        attachstack(c);
        c->isbanned = True;
        attach(c);
        attachstack(c);
        c->isbanned = True;
@@ -268,7 +268,7 @@ manage(Window w, XWindowAttributes *wa) {
 
 Client *
 nexttiled(Client *c) {
 
 Client *
 nexttiled(Client *c) {
-       for(; c && (c->swimming || !isvisible(c)); c = c->next);
+       for(; c && (c->versatile || !isvisible(c)); c = c->next);
        return c;
 }
 
        return c;
 }
 
@@ -440,7 +440,7 @@ zoom(Arg *arg) {
 
        if(!sel)
                return;
 
        if(!sel)
                return;
-       if(sel->swimming || (lt->arrange == swim)) {
+       if(sel->versatile || (lt->arrange == versatile)) {
                togglemax(sel);
                return;
        }
                togglemax(sel);
                return;
        }
index 7b54ca2..05bcd07 100644 (file)
@@ -9,7 +9,7 @@ const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL };
 static Layout layout[] = { \
        /* symbol               function */ \
        { "[]=",                tile }, /* first entry is default */ \
 static Layout layout[] = { \
        /* symbol               function */ \
        { "[]=",                tile }, /* first entry is default */ \
-       { "><>",                swim }, \
+       { "><>",                versatile }, \
 };
 
 #define BORDERPX               1
 };
 
 #define BORDERPX               1
@@ -64,7 +64,7 @@ static Key key[] = { \
        { MODKEY|ControlMask|ShiftMask, XK_9,           toggletag,      { .i = 8 } }, \
        { MODKEY|ShiftMask,             XK_c,           killclient,     { 0 } }, \
        { MODKEY,                       XK_space,       togglelayout,   { 0 } }, \
        { MODKEY|ControlMask|ShiftMask, XK_9,           toggletag,      { .i = 8 } }, \
        { MODKEY|ShiftMask,             XK_c,           killclient,     { 0 } }, \
        { MODKEY,                       XK_space,       togglelayout,   { 0 } }, \
-       { MODKEY|ShiftMask,             XK_space,       toggleswimming, { 0 } }, \
+       { MODKEY|ShiftMask,             XK_space,       toggleversatile,{ 0 } }, \
        { MODKEY,                       XK_0,           view,           { .i = -1 } }, \
        { MODKEY,                       XK_1,           view,           { .i = 0 } }, \
        { MODKEY,                       XK_2,           view,           { .i = 1 } }, \
        { MODKEY,                       XK_0,           view,           { .i = -1 } }, \
        { MODKEY,                       XK_1,           view,           { .i = 0 } }, \
        { MODKEY,                       XK_2,           view,           { .i = 1 } }, \
@@ -89,7 +89,7 @@ static Key key[] = { \
 
 #define RULES \
 static Rule rule[] = { \
 
 #define RULES \
 static Rule rule[] = { \
-       /* class:instance:title regex   tags regex      swimming */ \
+       /* class:instance:title regex   tags regex      versatile */ \
        { "Firefox",                    "3",            False }, \
        { "Gimp",                       NULL,           True }, \
        { "MPlayer",                    NULL,           True }, \
        { "Firefox",                    "3",            False }, \
        { "Gimp",                       NULL,           True }, \
        { "MPlayer",                    NULL,           True }, \
index 1b6b349..10000d9 100644 (file)
@@ -9,7 +9,7 @@ const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL };
 Layout layout[] = { \
        /* symbol               function */ \
        { "[]=",                tile }, /* first entry is default */ \
 Layout layout[] = { \
        /* symbol               function */ \
        { "[]=",                tile }, /* first entry is default */ \
-       { "><>",                swim }, \
+       { "><>",                versatile }, \
 };
 
 #define BORDERPX               1
 };
 
 #define BORDERPX               1
@@ -59,7 +59,7 @@ static Key key[] = { \
        { MODKEY|ControlMask|ShiftMask, XK_9,           toggletag,      { .i = 8 } }, \
        { MODKEY|ShiftMask,             XK_c,           killclient,     { 0 } }, \
        { MODKEY,                       XK_space,       togglelayout,   { 0 } }, \
        { MODKEY|ControlMask|ShiftMask, XK_9,           toggletag,      { .i = 8 } }, \
        { MODKEY|ShiftMask,             XK_c,           killclient,     { 0 } }, \
        { MODKEY,                       XK_space,       togglelayout,   { 0 } }, \
-       { MODKEY|ShiftMask,             XK_space,       toggleswimming, { 0 } }, \
+       { MODKEY|ShiftMask,             XK_space,       toggleversatile { 0 } }, \
        { MODKEY,                       XK_0,           view,           { .i = -1 } }, \
        { MODKEY,                       XK_1,           view,           { .i = 0 } }, \
        { MODKEY,                       XK_2,           view,           { .i = 1 } }, \
        { MODKEY,                       XK_0,           view,           { .i = -1 } }, \
        { MODKEY,                       XK_1,           view,           { .i = 0 } }, \
        { MODKEY,                       XK_2,           view,           { .i = 1 } }, \
@@ -86,7 +86,7 @@ static Key key[] = { \
  * xprop | awk -F '"' '/^WM_CLASS/ { printf("%s:%s:",$4,$2) }; /^WM_NAME/ { printf("%s\n",$2) }' */
 #define RULES \
 static Rule rule[] = { \
  * xprop | awk -F '"' '/^WM_CLASS/ { printf("%s:%s:",$4,$2) }; /^WM_NAME/ { printf("%s\n",$2) }' */
 #define RULES \
 static Rule rule[] = { \
-       /* class:instance:title regex   tags regex      swimming */ \
+       /* class:instance:title regex   tags regex      versatile */ \
        { "Gimp",                       NULL,           True }, \
        { "MPlayer",                    NULL,           True }, \
        { "Acroread",                   NULL,           True }, \
        { "Gimp",                       NULL,           True }, \
        { "MPlayer",                    NULL,           True }, \
        { "Acroread",                   NULL,           True }, \
diff --git a/dwm.1 b/dwm.1
index c48e853..cac0858 100644 (file)
--- a/dwm.1
+++ b/dwm.1
@@ -6,13 +6,13 @@ dwm \- dynamic window manager
 .RB [ \-v ]
 .SH DESCRIPTION
 dwm is a dynamic window manager for X. It manages windows in tiling and
 .RB [ \-v ]
 .SH DESCRIPTION
 dwm is a dynamic window manager for X. It manages windows in tiling and
-swimming layouts. Either layout can be applied dynamically, optimizing the
+versatile layouts. Either layout can be applied dynamically, optimizing the
 environment for the application in use and the task performed.
 .P
 In tiling layout windows are managed in a master and stacking area. The master
 area contains the windows which currently need most attention, whereas the
 environment for the application in use and the task performed.
 .P
 In tiling layout windows are managed in a master and stacking area. The master
 area contains the windows which currently need most attention, whereas the
-stacking area contains all other windows. In swimming layout windows can be
-resized and moved freely. Dialog windows are always managed swimming,
+stacking area contains all other windows. In versatile layout windows can be
+resized and moved freely. Dialog windows are always managed versatile,
 regardless of the layout applied.
 .P
 Windows are grouped by tags. Each window can be tagged with one or multiple
 regardless of the layout applied.
 .P
 Windows are grouped by tags. Each window can be tagged with one or multiple
@@ -38,7 +38,7 @@ is read and displayed in the status text area.
 .TP
 .B Button1
 click on a tag label to display all windows with that tag, click on the layout
 .TP
 .B Button1
 click on a tag label to display all windows with that tag, click on the layout
-label toggles between tiling and swimming layout.
+label toggles between tiling and versatile layout.
 .TP
 .B Button3
 click on a tag label adds/removes all windows with that tag to/from the view.
 .TP
 .B Button3
 click on a tag label adds/removes all windows with that tag to/from the view.
@@ -67,7 +67,7 @@ Focus next window.
 Focus previous window.
 .TP
 .B Mod1-Return
 Focus previous window.
 .TP
 .B Mod1-Return
-Zooms/cycles current window to/from master area (tiling layout), toggles maximization of current window (swimming layout).
+Zooms/cycles current window to/from master area (tiling layout), toggles maximization of current window (versatile layout).
 .TP
 .B Mod1-g
 Grow master area (tiling layout only).
 .TP
 .B Mod1-g
 Grow master area (tiling layout only).
@@ -98,10 +98,10 @@ tag to/from current window.
 Close focused window.
 .TP
 .B Mod1-space
 Close focused window.
 .TP
 .B Mod1-space
-Toggle between tiling and swimming layout (affects all windows).
+Toggle between tiling and versatile layout (affects all windows).
 .TP
 .B Mod1-Shift-space
 .TP
 .B Mod1-Shift-space
-Toggle focused window between swimming and non-swimming state (tiling layout only).
+Toggle focused window between versatile and non-versatile state (tiling layout only).
 .TP
 .B Mod1-[1..n]
 View all windows with
 .TP
 .B Mod1-[1..n]
 View all windows with
@@ -121,13 +121,13 @@ Quit dwm.
 .SS Mouse commands
 .TP
 .B Mod1-Button1
 .SS Mouse commands
 .TP
 .B Mod1-Button1
-Move current window while dragging (swimming layout only).
+Move current window while dragging (versatile layout only).
 .TP
 .B Mod1-Button2
 .TP
 .B Mod1-Button2
-Zooms/cycles current window to/from master area (tiling layout), toggles maximization of current window (swimming layout).
+Zooms/cycles current window to/from master area (tiling layout), toggles maximization of current window (versatile layout).
 .TP
 .B Mod1-Button3
 .TP
 .B Mod1-Button3
-Resize current window while dragging (swimming layout only).
+Resize current window while dragging (versatile layout only).
 .SH CUSTOMIZATION
 dwm is customized by creating a custom config.h and (re)compiling the source
 code. This keeps it fast, secure and simple.
 .SH CUSTOMIZATION
 dwm is customized by creating a custom config.h and (re)compiling the source
 code. This keeps it fast, secure and simple.
diff --git a/dwm.h b/dwm.h
index 0d63341..8e68776 100644 (file)
--- a/dwm.h
+++ b/dwm.h
@@ -72,7 +72,7 @@ struct Client {
        int minax, minay, maxax, maxay;
        long flags; 
        unsigned int border;
        int minax, minay, maxax, maxay;
        long flags; 
        unsigned int border;
-       Bool isbanned, isfixed, ismax, swimming;
+       Bool isbanned, isfixed, ismax, versatile;
        Bool *tags;
        Client *next;
        Client *prev;
        Bool *tags;
        Client *next;
        Client *prev;
@@ -135,12 +135,12 @@ extern Bool isvisible(Client *c);         /* returns True if client is visible */
 extern void resizemaster(Arg *arg);            /* resizes the master percent with arg's index value */
 extern void restack(void);                     /* restores z layers of all clients */
 extern void settags(Client *c, Client *trans); /* sets tags of c */
 extern void resizemaster(Arg *arg);            /* resizes the master percent with arg's index value */
 extern void restack(void);                     /* restores z layers of all clients */
 extern void settags(Client *c, Client *trans); /* sets tags of c */
-extern void swim(void);                                /* arranges all windows swimming */
 extern void tag(Arg *arg);                     /* tags c with arg's index */
 extern void tag(Arg *arg);                     /* tags c with arg's index */
-extern void toggleswimming(Arg *arg);          /* toggles focusesd client between swimming/and non-swimming state */
+extern void toggleversatile(Arg *arg);         /* toggles focusesd client between versatile/and non-versatile state */
 extern void togglelayout(Arg *arg);            /* toggles layout */
 extern void toggletag(Arg *arg);               /* toggles c tags with arg's index */
 extern void toggleview(Arg *arg);              /* toggles the tag with arg's index (in)visible */
 extern void togglelayout(Arg *arg);            /* toggles layout */
 extern void toggletag(Arg *arg);               /* toggles c tags with arg's index */
 extern void toggleview(Arg *arg);              /* toggles the tag with arg's index (in)visible */
+extern void versatile(void);                   /* arranges all windows versatile */
 extern void view(Arg *arg);                    /* views the tag with arg's index */
 
 /* util.c */
 extern void view(Arg *arg);                    /* views the tag with arg's index */
 
 /* util.c */
diff --git a/event.c b/event.c
index b8036fc..00c53b6 100644 (file)
--- a/event.c
+++ b/event.c
@@ -156,14 +156,14 @@ buttonpress(XEvent *e) {
                focus(c);
                if(CLEANMASK(ev->state) != MODKEY)
                        return;
                focus(c);
                if(CLEANMASK(ev->state) != MODKEY)
                        return;
-               if(ev->button == Button1 && (lt->arrange == swim || c->swimming)) {
+               if(ev->button == Button1 && (lt->arrange == versatile || c->versatile)) {
                        restack();
                        movemouse(c);
                }
                else if(ev->button == Button2)
                        zoom(NULL);
                else if(ev->button == Button3
                        restack();
                        movemouse(c);
                }
                else if(ev->button == Button2)
                        zoom(NULL);
                else if(ev->button == Button3
-               && (lt->arrange == swim || c->swimming) && !c->isfixed)
+               && (lt->arrange == versatile || c->versatile) && !c->isfixed)
                {
                        restack();
                        resizemouse(c);
                {
                        restack();
                        resizemouse(c);
@@ -181,7 +181,7 @@ configurerequest(XEvent *e) {
                c->ismax = False;
                if(ev->value_mask & CWBorderWidth)
                        c->border = ev->border_width;
                c->ismax = False;
                if(ev->value_mask & CWBorderWidth)
                        c->border = ev->border_width;
-               if(c->isfixed || c->swimming || (lt->arrange == swim)) {
+               if(c->isfixed || c->versatile || (lt->arrange == versatile)) {
                        if(ev->value_mask & CWX)
                                c->x = ev->x;
                        if(ev->value_mask & CWY)
                        if(ev->value_mask & CWX)
                                c->x = ev->x;
                        if(ev->value_mask & CWY)
@@ -309,7 +309,7 @@ propertynotify(XEvent *e) {
                        default: break;
                        case XA_WM_TRANSIENT_FOR:
                                XGetTransientForHint(dpy, c->win, &trans);
                        default: break;
                        case XA_WM_TRANSIENT_FOR:
                                XGetTransientForHint(dpy, c->win, &trans);
-                               if(!c->swimming && (c->swimming = (getclient(trans) != NULL)))
+                               if(!c->versatile && (c->versatile = (getclient(trans) != NULL)))
                                        lt->arrange();
                                break;
                        case XA_WM_NORMAL_HINTS:
                                        lt->arrange();
                                break;
                        case XA_WM_NORMAL_HINTS:
index 8086bd0..e0da2cf 100644 (file)
--- a/screen.c
+++ b/screen.c
@@ -19,7 +19,7 @@ Layout *lt = NULL;
 typedef struct {
        const char *prop;
        const char *tags;
 typedef struct {
        const char *prop;
        const char *tags;
-       Bool swimming;
+       Bool versatile;
 } Rule;
 
 typedef struct {
 } Rule;
 
 typedef struct {
@@ -52,7 +52,7 @@ tile(void) {
                        if(c->isbanned)
                                XMoveWindow(dpy, c->win, c->x, c->y);
                        c->isbanned = False;
                        if(c->isbanned)
                                XMoveWindow(dpy, c->win, c->x, c->y);
                        c->isbanned = False;
-                       if(c->swimming)
+                       if(c->versatile)
                                continue;
                        c->ismax = False;
                        nx = wax;
                                continue;
                        c->ismax = False;
                        nx = wax;
@@ -175,10 +175,10 @@ restack(void) {
        drawstatus();
        if(!sel)
                return;
        drawstatus();
        if(!sel)
                return;
-       if(sel->swimming || lt->arrange == swim)
+       if(sel->versatile || lt->arrange == versatile)
                XRaiseWindow(dpy, sel->win);
                XRaiseWindow(dpy, sel->win);
-       if(lt->arrange != swim) {
-               if(!sel->swimming)
+       if(lt->arrange != versatile) {
+               if(!sel->versatile)
                        XLowerWindow(dpy, sel->win);
                for(c = nexttiled(clients); c; c = nexttiled(c->next)) {
                        if(c == sel)
                        XLowerWindow(dpy, sel->win);
                for(c = nexttiled(clients); c; c = nexttiled(c->next)) {
                        if(c == sel)
@@ -208,7 +208,7 @@ settags(Client *c, Client *trans) {
                                ch.res_name ? ch.res_name : "", c->name);
                for(i = 0; i < nrules; i++)
                        if(regs[i].propregex && !regexec(regs[i].propregex, prop, 1, &tmp, 0)) {
                                ch.res_name ? ch.res_name : "", c->name);
                for(i = 0; i < nrules; i++)
                        if(regs[i].propregex && !regexec(regs[i].propregex, prop, 1, &tmp, 0)) {
-                               c->swimming = rule[i].swimming;
+                               c->versatile = rule[i].versatile;
                                for(j = 0; regs[i].tagregex && j < ntags; j++) {
                                        if(!regexec(regs[i].tagregex, tags[j], 1, &tmp, 0)) {
                                                matched = True;
                                for(j = 0; regs[i].tagregex && j < ntags; j++) {
                                        if(!regexec(regs[i].tagregex, tags[j], 1, &tmp, 0)) {
                                                matched = True;
@@ -227,29 +227,6 @@ settags(Client *c, Client *trans) {
 }
 
 void
 }
 
 void
-swim(void) {
-       Client *c;
-
-       for(c = clients; c; c = c->next) {
-               if(isvisible(c)) {
-                       if(c->isbanned)
-                               XMoveWindow(dpy, c->win, c->x, c->y);
-                       c->isbanned = False;
-                       resize(c, c->x, c->y, c->w, c->h, True);
-               }
-               else {
-                       c->isbanned = True;
-                       XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
-               }
-       }
-       if(!sel || !isvisible(sel)) {
-               for(c = stack; c && !isvisible(c); c = c->snext);
-               focus(c);
-       }
-       restack();
-}
-
-void
 tag(Arg *arg) {
        unsigned int i;
 
 tag(Arg *arg) {
        unsigned int i;
 
@@ -263,14 +240,6 @@ tag(Arg *arg) {
 }
 
 void
 }
 
 void
-toggleswimming(Arg *arg) {
-       if(!sel || lt->arrange == swim)
-               return;
-       sel->swimming = !sel->swimming;
-       lt->arrange();
-}
-
-void
 toggletag(Arg *arg) {
        unsigned int i;
 
 toggletag(Arg *arg) {
        unsigned int i;
 
@@ -299,6 +268,14 @@ togglelayout(Arg *arg) {
 }
 
 void
 }
 
 void
+toggleversatile(Arg *arg) {
+       if(!sel || lt->arrange == versatile)
+               return;
+       sel->versatile = !sel->versatile;
+       lt->arrange();
+}
+
+void
 toggleview(Arg *arg) {
        unsigned int i;
 
 toggleview(Arg *arg) {
        unsigned int i;
 
@@ -310,6 +287,29 @@ toggleview(Arg *arg) {
 }
 
 void
 }
 
 void
+versatile(void) {
+       Client *c;
+
+       for(c = clients; c; c = c->next) {
+               if(isvisible(c)) {
+                       if(c->isbanned)
+                               XMoveWindow(dpy, c->win, c->x, c->y);
+                       c->isbanned = False;
+                       resize(c, c->x, c->y, c->w, c->h, True);
+               }
+               else {
+                       c->isbanned = True;
+                       XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
+               }
+       }
+       if(!sel || !isvisible(sel)) {
+               for(c = stack; c && !isvisible(c); c = c->snext);
+               focus(c);
+       }
+       restack();
+}
+
+void
 view(Arg *arg) {
        unsigned int i;
 
 view(Arg *arg) {
        unsigned int i;