Put W->tag_ciruclar in W->flags as a flag (WMFS_TAGCIRC) ; Add padding option (Closes #19)

This commit is contained in:
David Delassus 2012-05-01 22:10:08 +02:00
parent eecde8774c
commit 5714d5470b
5 changed files with 23 additions and 17 deletions

View File

@ -1174,13 +1174,13 @@ client_moveresize(struct client *c, struct geo *g)
}
XMoveResizeWindow(W->dpy, c->frame,
c->rgeo.x, c->rgeo.y,
c->rgeo.w, c->rgeo.h);
c->rgeo.x + W->padding / 4, c->rgeo.y + W->padding / 4,
c->rgeo.w - W->padding / 2, c->rgeo.h - W->padding / 2);
if(!(c->flags & CLIENT_FULLSCREEN))
XMoveResizeWindow(W->dpy, c->win,
c->wgeo.x, c->wgeo.y,
c->wgeo.w, c->wgeo.h);
c->wgeo.w - W->padding / 2, c->wgeo.h - W->padding / 2);
c->flags &= ~CLIENT_DID_WINSIZE;

View File

@ -192,7 +192,8 @@ config_tag(void)
ks = fetch_section(sec, "tag");
n = fetch_section_count(ks);
W->tag_circular = fetch_opt_first(sec, "1", "circular").boolean;
if (fetch_opt_first(sec, "1", "circular").boolean)
W->flags |= WMFS_TAGCIRC;
/* [mouse] */
if((mb = fetch_section(sec, "mouse")))
@ -236,6 +237,7 @@ config_client(void)
/* [client] */
sec = fetch_section_first(NULL, "client");
W->padding = fetch_opt_first(sec, "0", "padding").num;
W->client_mod = modkey_keysym(fetch_opt_first(sec, "Super", "key_modifier").str);
/* Get theme */

View File

@ -170,7 +170,7 @@ uicb_tag_next(Uicb cmd)
if((t = TAILQ_NEXT(W->screen->seltag, next)))
tag_screen(W->screen, t);
else if(W->tag_circular)
else if(W->flags & WMFS_TAGCIRC)
tag_screen(W->screen, TAILQ_FIRST(&W->screen->tags));
}
@ -182,7 +182,7 @@ uicb_tag_prev(Uicb cmd)
if((t = TAILQ_PREV(W->screen->seltag, tsub, next)))
tag_screen(W->screen, t);
else if(W->tag_circular)
else if(W->flags & WMFS_TAGCIRC)
tag_screen(W->screen, TAILQ_LAST(&W->screen->tags, tsub));
}
@ -214,7 +214,7 @@ uicb_tag_move_client_next(Uicb cmd)
if((t = TAILQ_NEXT(W->screen->seltag, next)))
tag_client(t, W->client);
else if(W->tag_circular)
else if(W->flags & WMFS_TAGCIRC)
tag_client(TAILQ_FIRST(&W->screen->tags), W->client);
}
@ -229,7 +229,7 @@ uicb_tag_move_client_prev(Uicb cmd)
if((t = TAILQ_PREV(W->screen->seltag, tsub, next)))
tag_client(t, W->client);
else if(W->tag_circular)
else if(W->flags & WMFS_TAGCIRC)
tag_client(TAILQ_LAST(&W->screen->tags, tsub), W->client);
}

View File

@ -335,14 +335,15 @@ struct wmfs
int nscreen;
unsigned int client_mod;
Flags numlockmask;
#define WMFS_SCAN 0x01
#define WMFS_RUNNING 0x02
#define WMFS_RELOAD 0x04
#define WMFS_SYSTRAY 0x08
#define WMFS_LOG 0x10
#define WMFS_LAUNCHER 0x20
#define WMFS_SIGCHLD 0x40
#define WMFS_TABNOC 0x80 /* tab next opened client */
#define WMFS_SCAN 0x001
#define WMFS_RUNNING 0x002
#define WMFS_RELOAD 0x004
#define WMFS_SYSTRAY 0x008
#define WMFS_LOG 0x010
#define WMFS_LAUNCHER 0x020
#define WMFS_SIGCHLD 0x040
#define WMFS_TABNOC 0x080 /* tab next opened client */
#define WMFS_TAGCIRC 0x100 /* tab_next on last tag -> go to first tag / tab_prev on first tag -> go to last tag */
Flags flags;
GC gc, rgc;
Atom *net_atom;
@ -354,7 +355,7 @@ struct wmfs
#define CFOCUS_CLICK 0x02
Flags cfocus; /* Focus configuration, can be set to 0, CFOCUS_ENTER or CFOCUS_CLICK*/
bool tag_circular;
int padding;
/* Log file */
FILE *log;

3
wmfsrc
View File

@ -117,6 +117,9 @@
[client]
# Padding betwen clients (default: 0) :
# padding = 75
theme = "default"
key_modifier = "Super"