1
0
mirror of git://git.suckless.org/dwm synced 2025-08-03 21:52:12 -07:00

Compare commits

...

23 Commits
1.9 ... 2.0

Author SHA1 Message Date
arg@mig29
04b633ddf3 make sure that changing sx has no impact on snapping 2006-10-31 09:02:16 +01:00
arg@mig29
b76561a212 in a 1920x1200 setup 40 pixels of snap value are much better than 20 2006-10-30 12:40:10 +01:00
arg@mig29
51c7589c87 fixed stupid bug of snap-to-screen 2006-10-30 12:26:55 +01:00
arg@mig29
99785382ae changing snap priority 2006-10-30 12:07:00 +01:00
arg@mig29
dc1690ce0f removed useless abs() calls 2006-10-30 12:04:08 +01:00
arg@mig29
b6614261ea added screen-border snapping in floating mode, feels quite well 2006-10-30 11:58:05 +01:00
arg@mig29
91e569ca37 and another fix 2006-10-27 13:29:35 +02:00
arg@mig29
0f395c1b11 applied sanders try2 patch 2006-10-27 13:28:26 +02:00
arg@mig29
2b13e7466f applied sanders max size fix 2006-10-27 12:05:47 +02:00
arg@mig29
0982e47408 stupid urxvt needs bg to highlight selections in a sane way, though that makes sense to some extend 2006-10-27 10:24:15 +02:00
arg@mig29
b93ebcf42f reverting to original 2006-10-26 15:41:40 +02:00
arg@mig29
a08d83ba62 applied sander's config.*h nitpick patch 2006-10-26 15:29:20 +02:00
arg@mig29
2b7c275ce8 some other change 2006-10-26 15:26:17 +02:00
arg@mig29
040d0f48a0 apply small fix to prevent apps like mplayer wandering when toggling fullscreen 2006-10-26 15:05:45 +02:00
arg@mig29
724f35a664 forgot to use -tr, which actually prevents the ugly flicker (using xsetroot -solid black as root window pixmap to make this work nicely) 2006-10-26 12:22:26 +02:00
arg@mig29
6f3872edbd using MASTER 600 again, it is definately better, and using urxvtc for the moment (it doesn't flickers on refreshes, but this is not because of Marc Lehmann, it is because of the original rxvt code) 2006-10-26 12:13:41 +02:00
arg@mig29
87324e680c changing MASTER in config.arg.h from 600 to 550 per thousand 2006-10-26 11:21:45 +02:00
arg@mig29
c2b908f603 my new 1920x1200 Z61p arrived, now I can use terminus in a sane way... 2006-10-26 10:21:27 +02:00
Anselm R. Garbe
d7734f996f moved MOUSEMASK into event.c (not used in other places) 2006-10-16 16:50:03 +02:00
Anselm R. Garbe
8b68890650 now being at v2.0 2006-10-14 18:21:39 +02:00
Anselm R. Garbe
b60406cb9b using lsx instead of Jukka's shell construct 2006-10-13 18:47:24 +02:00
Anselm R. Garbe
ce9a9934ec hotfix 2006-10-06 14:01:53 +02:00
Anselm R. Garbe
720b2abe17 Added tag 1.9 for changeset a5567a0d30112822db2627a04a2e7aa3b6c38148 2006-10-06 13:43:59 +02:00
8 changed files with 35 additions and 20 deletions

View File

@@ -17,3 +17,4 @@ ad3fa2d185426c51fd5deceae809770363f8d33c 1.6
4dbdb61c8b8ce21dee5c7050a6b103855964ed20 1.7
d5ad819f2a66a40fa75dd2e44429f3bfc884d07b 1.7.1
c71952fa3c7ca848ec38a6923b5c6d0e18fff431 1.8
a5567a0d30112822db2627a04a2e7aa3b6c38148 1.9

View File

@@ -202,12 +202,12 @@ manage(Window w, XWindowAttributes *wa) {
c = emallocz(sizeof(Client));
c->tags = emallocz(ntags * sizeof(Bool));
c->win = w;
c->border = 0;
c->x = c->tx = wa->x;
c->y = c->ty = wa->y;
c->w = c->tw = wa->width;
c->h = wa->height;
c->th = bh;
c->border = 0;
updatesize(c);
if(c->x + c->w + 2 * BORDERPX > sw)
c->x = sw - c->w - 2 * BORDERPX;
@@ -232,9 +232,7 @@ manage(Window w, XWindowAttributes *wa) {
updatetitle(c);
settags(c, getclient(trans));
if(!c->isfloat)
c->isfloat = trans
|| (c->maxw && c->minw &&
c->maxw == c->minw && c->maxh == c->minh);
c->isfloat = trans || c->isfixed;
resizetitle(c);
if(clients)
clients->prev = c;
@@ -341,6 +339,8 @@ updatesize(Client *c) {
}
else
c->minw = c->minh = 0;
c->isfixed = (c->maxw && c->minw && c->maxh && c->minh &&
c->maxw == c->minw && c->maxh == c->minh);
if(c->flags & PWinGravity)
c->grav = size.win_gravity;
else

View File

@@ -9,7 +9,7 @@ const char *tags[] = { "dev", "work", "net", "fnord", NULL };
#define FLOATSYMBOL "><>"
#define TILESYMBOL "[]="
#define FONT "-*-terminus-medium-*-*-*-12-*-*-*-*-*-iso10646-*"
#define FONT "-*-terminus-medium-*-*-*-14-*-*-*-*-*-*-*"
#define NORMBGCOLOR "#333333"
#define NORMFGCOLOR "#dddddd"
#define SELBGCOLOR "#333366"
@@ -19,17 +19,17 @@ const char *tags[] = { "dev", "work", "net", "fnord", NULL };
#define MASTER 600 /* per thousand */
#define MODKEY Mod1Mask
#define SNAP 40 /* pixel */
#define KEYS \
static Key key[] = { \
/* modifier key function arguments */ \
{ MODKEY|ShiftMask, XK_Return, spawn, \
{ .cmd = "exec uxterm -bg '#111111' -fg '#eeeeee' -cr '#eeeeee' +sb -fn '"FONT"'" } }, \
{ .cmd = "exec urxvtc -tr -bg black -fg '#eeeeee' -cr '#eeeeee' +sb -fn '"FONT"'" } }, \
{ MODKEY, XK_p, spawn, \
{ .cmd = "exe=\"$(IFS=:; for dir in $PATH; do " \
"for file in \"$dir\"/*; do [ -x \"$file\" ] && echo \"${file##*/}\"; done; done " \
"| sort -u | dmenu -font '"FONT"' -normbg '"NORMBGCOLOR"' -normfg '"NORMFGCOLOR"' " \
"-selbg '"SELBGCOLOR"' -selfg '"SELFGCOLOR"')\" && exec $exe" } }, \
{ .cmd = "exe=\"$(lsx `echo $PATH | sed 's/:/ /g'` | sort -u " \
" | dmenu -font '"FONT"' -normbg '"NORMBGCOLOR"' -normfg '"NORMFGCOLOR"' " \
"-selbg '"SELBGCOLOR"' -selfg '"SELFGCOLOR"')\" && exec $exe" } }, \
{ MODKEY, XK_j, focusnext, { 0 } }, \
{ MODKEY, XK_k, focusprev, { 0 } }, \
{ MODKEY, XK_Return, zoom, { 0 } }, \
@@ -60,8 +60,8 @@ static Key key[] = { \
#define RULES \
static Rule rule[] = { \
/* class:instance:title regex tags regex isfloat */ \
{ "Firefox.*", "net", False}, \
{ "Gimp.*", NULL, True}, \
{ "MPlayer.*", NULL, True}, \
{ "Acroread.*", NULL, True}, \
{ "Firefox.*", "net", False }, \
{ "Gimp.*", NULL, True }, \
{ "MPlayer.*", NULL, True }, \
{ "Acroread.*", NULL, True }, \
};

View File

@@ -19,6 +19,7 @@ const char *tags[] = { "1", "2", "3", "4", "5", NULL };
#define MASTER 600 /* per thousand */
#define MODKEY Mod1Mask
#define SNAP 20 /* pixel */
#define KEYS \
static Key key[] = { \
@@ -61,5 +62,5 @@ static Key key[] = { \
static Rule rule[] = { \
/* class:instance:title regex tags regex isfloat */ \
{ "Firefox.*", "2", False }, \
{ "Gimp.*", NULL, True}, \
{ "Gimp.*", NULL, True }, \
};

View File

@@ -1,5 +1,5 @@
# dwm version
VERSION = 1.9
VERSION = 2.0
# Customize below to fit your system

3
dwm.h
View File

@@ -36,7 +36,6 @@
/* mask shorthands, used in event.c and client.c */
#define BUTTONMASK (ButtonPressMask | ButtonReleaseMask)
#define MOUSEMASK (BUTTONMASK | PointerMotionMask)
/* other stuff used in different places */
#define BORDERPX 1
#define PROTODELWIN 1
@@ -84,7 +83,7 @@ struct Client {
int grav;
long flags;
unsigned int border, weight;
Bool isfloat, ismax;
Bool isfloat, isfixed, ismax;
Bool *tags;
Client *next;
Client *prev;

12
event.c
View File

@@ -18,6 +18,7 @@ typedef struct {
KEYS
#define CLEANMASK(mask) (mask & ~(numlockmask | LockMask))
#define MOUSEMASK (BUTTONMASK | PointerMotionMask)
static void
movemouse(Client *c) {
@@ -47,6 +48,14 @@ movemouse(Client *c) {
XSync(dpy, False);
c->x = ocx + (ev.xmotion.x - x1);
c->y = ocy + (ev.xmotion.y - y1);
if(abs(sx + c->x) < SNAP)
c->x = sx;
else if(abs((sx + sw) - (c->x + c->w)) < SNAP)
c->x = sw - c->w - 2 * BORDERPX;
if(abs((sy + bh) - c->y) < SNAP)
c->y = sy + bh;
else if(abs((sy + sh) - (c->y + c->h)) < SNAP)
c->y = sh - c->h - 2 * BORDERPX;
resize(c, False, TopLeft);
break;
}
@@ -135,7 +144,8 @@ buttonpress(XEvent *e) {
}
else if(ev->button == Button2)
zoom(NULL);
else if(ev->button == Button3 && (arrange == dofloat || c->isfloat)) {
else if(ev->button == Button3 && (arrange == dofloat || c->isfloat) &&
!c->isfixed) {
restack();
resizemouse(c);
}

6
view.c
View File

@@ -44,6 +44,9 @@ reorder(void) {
static void
togglemax(Client *c) {
XEvent ev;
if(c->isfixed)
return;
if((c->ismax = !c->ismax)) {
c->rx = c->x; c->x = sx;
@@ -108,7 +111,7 @@ dotile(void) {
if(n > 1)
th /= (n - 1);
for(i = 0, c = clients; c; c = c->next, i++)
for(i = 0, c = clients; c; c = c->next)
if(isvisible(c)) {
if(c->isfloat) {
resize(c, True, TopLeft);
@@ -139,6 +142,7 @@ dotile(void) {
c->h = stackh - 2 * BORDERPX;
}
resize(c, False, TopLeft);
i++;
}
else
ban(c);