Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
01d13b0c49 | |||
f15f45a9f8 | |||
1b2e149cb4 | |||
6136640ec9 | |||
95d8423823 | |||
de6411c338 | |||
e316cf53f6 | |||
c107db57db | |||
d39d00057c | |||
26157e6973 | |||
6d22782e8f | |||
1836b6740d | |||
924a088812 | |||
bab575c868 | |||
daae3bba50 | |||
05fbbbd8dc | |||
4c368bcd24 | |||
9927b9e642 | |||
1b492dffc8 |
3
.hgtags
3
.hgtags
@ -9,3 +9,6 @@ cd15de32e173f8ce97bfe1c9b6607937b59056b4 0.8
|
|||||||
fae61afa861755636c4a1070694209ace8efbb6c 0.9
|
fae61afa861755636c4a1070694209ace8efbb6c 0.9
|
||||||
bbc98e77ae89a7c9232a5be0835f60ea00d8036e 1.0
|
bbc98e77ae89a7c9232a5be0835f60ea00d8036e 1.0
|
||||||
44a55e6e46bf6c231780b09d919977d6f01083de 1.1
|
44a55e6e46bf6c231780b09d919977d6f01083de 1.1
|
||||||
|
e3179ce2b90451d2807cd53b589d768412b8666b 1.2
|
||||||
|
6413ea66b1c2496cfc2173fe58df67cb965eb1da 1.3
|
||||||
|
dd44dc937e8b0a46abf1a15a333dba5304e4fe89 1.3
|
||||||
|
55
client.c
55
client.c
@ -82,22 +82,29 @@ ban(Client *c)
|
|||||||
void
|
void
|
||||||
focus(Client *c)
|
focus(Client *c)
|
||||||
{
|
{
|
||||||
Client *old = sel;
|
Client *old;
|
||||||
|
|
||||||
if(!issel)
|
if(!issel)
|
||||||
return;
|
return;
|
||||||
if(!sel)
|
if(!sel)
|
||||||
sel = c;
|
sel = c;
|
||||||
else if(sel != c) {
|
else if(sel != c) {
|
||||||
if(sel->ismax)
|
if(maximized)
|
||||||
togglemax(NULL);
|
togglemax(NULL);
|
||||||
|
old = sel;
|
||||||
sel = c;
|
sel = c;
|
||||||
grabbuttons(old, False);
|
if(old) {
|
||||||
drawtitle(old);
|
grabbuttons(old, False);
|
||||||
|
drawtitle(old);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
grabbuttons(c, True);
|
if(c) {
|
||||||
drawtitle(c);
|
grabbuttons(c, True);
|
||||||
XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
|
drawtitle(c);
|
||||||
|
XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
Client *
|
Client *
|
||||||
@ -247,13 +254,12 @@ manage(Window w, XWindowAttributes *wa)
|
|||||||
clients = c;
|
clients = c;
|
||||||
|
|
||||||
settitle(c);
|
settitle(c);
|
||||||
if(isvisible(c))
|
ban(c);
|
||||||
sel = c;
|
|
||||||
arrange(NULL);
|
|
||||||
XMapWindow(dpy, c->win);
|
XMapWindow(dpy, c->win);
|
||||||
XMapWindow(dpy, c->twin);
|
XMapWindow(dpy, c->twin);
|
||||||
if(isvisible(c))
|
if(isvisible(c))
|
||||||
focus(c);
|
focus(c);
|
||||||
|
arrange(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -366,12 +372,13 @@ void
|
|||||||
togglemax(Arg *arg)
|
togglemax(Arg *arg)
|
||||||
{
|
{
|
||||||
int ox, oy, ow, oh;
|
int ox, oy, ow, oh;
|
||||||
|
Client *c;
|
||||||
XEvent ev;
|
XEvent ev;
|
||||||
|
|
||||||
if(!sel)
|
if(!sel)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if((sel->ismax = !sel->ismax)) {
|
if((maximized = !maximized)) {
|
||||||
ox = sel->x;
|
ox = sel->x;
|
||||||
oy = sel->y;
|
oy = sel->y;
|
||||||
ow = sel->w;
|
ow = sel->w;
|
||||||
@ -382,6 +389,9 @@ togglemax(Arg *arg)
|
|||||||
sel->h = sh - 2 - bh;
|
sel->h = sh - 2 - bh;
|
||||||
|
|
||||||
restack();
|
restack();
|
||||||
|
for(c = getnext(clients); c; c = getnext(c->next))
|
||||||
|
if(c != sel)
|
||||||
|
ban(c);
|
||||||
resize(sel, arrange == dofloat, TopLeft);
|
resize(sel, arrange == dofloat, TopLeft);
|
||||||
|
|
||||||
sel->x = ox;
|
sel->x = ox;
|
||||||
@ -390,37 +400,36 @@ togglemax(Arg *arg)
|
|||||||
sel->h = oh;
|
sel->h = oh;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
resize(sel, False, TopLeft);
|
arrange(NULL);
|
||||||
while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
|
while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
unmanage(Client *c)
|
unmanage(Client *c)
|
||||||
{
|
{
|
||||||
Client *tc;
|
Client *tc, *fc;
|
||||||
Window trans;
|
Window trans;
|
||||||
XGrabServer(dpy);
|
XGrabServer(dpy);
|
||||||
XSetErrorHandler(xerrordummy);
|
XSetErrorHandler(xerrordummy);
|
||||||
|
|
||||||
XGetTransientForHint(dpy, c->win, &trans);
|
detach(c);
|
||||||
|
if(sel == c) {
|
||||||
|
XGetTransientForHint(dpy, c->win, &trans);
|
||||||
|
if(trans && (tc = getclient(trans)) && isvisible(tc))
|
||||||
|
fc = tc;
|
||||||
|
else
|
||||||
|
fc = getnext(clients);
|
||||||
|
focus(fc);
|
||||||
|
}
|
||||||
|
|
||||||
XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
|
XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
|
||||||
XDestroyWindow(dpy, c->twin);
|
XDestroyWindow(dpy, c->twin);
|
||||||
|
|
||||||
detach(c);
|
|
||||||
if(sel == c) {
|
|
||||||
if(trans && (tc = getclient(trans)) && isvisible(tc))
|
|
||||||
sel = tc;
|
|
||||||
else
|
|
||||||
sel = getnext(clients);
|
|
||||||
}
|
|
||||||
free(c->tags);
|
free(c->tags);
|
||||||
free(c);
|
free(c);
|
||||||
|
|
||||||
XSync(dpy, False);
|
XSync(dpy, False);
|
||||||
XSetErrorHandler(xerror);
|
XSetErrorHandler(xerror);
|
||||||
XUngrabServer(dpy);
|
XUngrabServer(dpy);
|
||||||
if(sel)
|
|
||||||
focus(sel);
|
|
||||||
arrange(NULL);
|
arrange(NULL);
|
||||||
}
|
}
|
||||||
|
@ -27,9 +27,9 @@ static Key key[] = { \
|
|||||||
{ MODKEY|ShiftMask, XK_Return, spawn, \
|
{ MODKEY|ShiftMask, XK_Return, spawn, \
|
||||||
{ .cmd = "exec uxterm -bg '#111111' -fg '#eeeeee' -cr '#eeeeee' +sb -fn '"FONT"'" } }, \
|
{ .cmd = "exec uxterm -bg '#111111' -fg '#eeeeee' -cr '#eeeeee' +sb -fn '"FONT"'" } }, \
|
||||||
{ MODKEY, XK_p, spawn, \
|
{ MODKEY, XK_p, spawn, \
|
||||||
{ .cmd = "exec \"$(IFS=:; for dir in $PATH; do " \
|
{ .cmd = "exe=\"$(IFS=:; for dir in $PATH; do " \
|
||||||
"for file in \"$dir\"/*; do [ -x \"$file\" ] && echo \"${file##*/}\"; done; " \
|
"for file in \"$dir\"/*; do [ -x \"$file\" ] && echo \"${file##*/}\"; done; " \
|
||||||
"done | sort -u | dmenu)\"" } }, \
|
"done | sort -u | dmenu)\" && exec \"$exe\"" } }, \
|
||||||
{ MODKEY, XK_j, focusnext, { 0 } }, \
|
{ MODKEY, XK_j, focusnext, { 0 } }, \
|
||||||
{ MODKEY, XK_k, focusprev, { 0 } }, \
|
{ MODKEY, XK_k, focusprev, { 0 } }, \
|
||||||
{ MODKEY, XK_Return, zoom, { 0 } }, \
|
{ MODKEY, XK_Return, zoom, { 0 } }, \
|
||||||
@ -44,6 +44,7 @@ static Key key[] = { \
|
|||||||
{ MODKEY|ControlMask|ShiftMask, XK_4, toggletag, { .i = 3 } }, \
|
{ MODKEY|ControlMask|ShiftMask, XK_4, toggletag, { .i = 3 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_c, killclient, { 0 } }, \
|
{ MODKEY|ShiftMask, XK_c, killclient, { 0 } }, \
|
||||||
{ MODKEY, XK_space, togglemode, { 0 } }, \
|
{ MODKEY, XK_space, togglemode, { 0 } }, \
|
||||||
|
{ MODKEY, XK_0, viewall, { 0 } }, \
|
||||||
{ MODKEY, XK_1, view, { .i = 0 } }, \
|
{ MODKEY, XK_1, view, { .i = 0 } }, \
|
||||||
{ MODKEY, XK_2, view, { .i = 1 } }, \
|
{ MODKEY, XK_2, view, { .i = 1 } }, \
|
||||||
{ MODKEY, XK_3, view, { .i = 2 } }, \
|
{ MODKEY, XK_3, view, { .i = 2 } }, \
|
||||||
|
@ -41,6 +41,7 @@ static Key key[] = { \
|
|||||||
{ MODKEY|ControlMask|ShiftMask, XK_5, toggletag, { .i = 4 } }, \
|
{ MODKEY|ControlMask|ShiftMask, XK_5, toggletag, { .i = 4 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_c, killclient, { 0 } }, \
|
{ MODKEY|ShiftMask, XK_c, killclient, { 0 } }, \
|
||||||
{ MODKEY, XK_space, togglemode, { 0 } }, \
|
{ MODKEY, XK_space, togglemode, { 0 } }, \
|
||||||
|
{ MODKEY, XK_0, viewall, { 0 } }, \
|
||||||
{ MODKEY, XK_1, view, { .i = 0 } }, \
|
{ MODKEY, XK_1, view, { .i = 0 } }, \
|
||||||
{ MODKEY, XK_2, view, { .i = 1 } }, \
|
{ MODKEY, XK_2, view, { .i = 1 } }, \
|
||||||
{ MODKEY, XK_3, view, { .i = 2 } }, \
|
{ MODKEY, XK_3, view, { .i = 2 } }, \
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# dwm version
|
# dwm version
|
||||||
VERSION = 1.2
|
VERSION = 1.3
|
||||||
|
|
||||||
# Customize below to fit your system
|
# Customize below to fit your system
|
||||||
|
|
||||||
|
24
dwm.1
24
dwm.1
@ -51,6 +51,18 @@ mode.
|
|||||||
click on a tag label adds/removes all windows with that
|
click on a tag label adds/removes all windows with that
|
||||||
.B tag
|
.B tag
|
||||||
to/from the view.
|
to/from the view.
|
||||||
|
.TP
|
||||||
|
.B Mod1-Button1
|
||||||
|
click on a tag label applies that
|
||||||
|
.B tag
|
||||||
|
to the focused
|
||||||
|
.BR window .
|
||||||
|
.TP
|
||||||
|
.B Mod1-Button3
|
||||||
|
click on a tag label adds/removes that
|
||||||
|
.B tag
|
||||||
|
to/from the focused
|
||||||
|
.BR window .
|
||||||
.SS Keyboard commands
|
.SS Keyboard commands
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Shift-Return
|
.B Mod1-Shift-Return
|
||||||
@ -78,13 +90,13 @@ mode only).
|
|||||||
Maximize current
|
Maximize current
|
||||||
.BR window .
|
.BR window .
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Shift-[0..n]
|
.B Mod1-Shift-[1..n]
|
||||||
Apply
|
Apply
|
||||||
.B nth tag
|
.B nth tag
|
||||||
to current
|
to current
|
||||||
.BR window .
|
.BR window .
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Control-Shift-[0..n]
|
.B Mod1-Control-Shift-[1..n]
|
||||||
Add/remove
|
Add/remove
|
||||||
.B nth tag
|
.B nth tag
|
||||||
to/from current
|
to/from current
|
||||||
@ -102,11 +114,15 @@ and
|
|||||||
mode (affects
|
mode (affects
|
||||||
.BR "all windows" ).
|
.BR "all windows" ).
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-[0..n]
|
.B Mod1-[1..n]
|
||||||
View all windows with
|
View all windows with
|
||||||
.BR "tag n" .
|
.BR "tag n" .
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Control-[0..n]
|
.B Mod1-0
|
||||||
|
View all windows with any
|
||||||
|
.BR "tag" .
|
||||||
|
.TP
|
||||||
|
.B Mod1-Control-[1..n]
|
||||||
Add/remove all windows with
|
Add/remove all windows with
|
||||||
.B tag n
|
.B tag n
|
||||||
to/from the view.
|
to/from the view.
|
||||||
|
4
dwm.h
4
dwm.h
@ -58,7 +58,6 @@ struct Client {
|
|||||||
long flags;
|
long flags;
|
||||||
unsigned int border, weight;
|
unsigned int border, weight;
|
||||||
Bool isfloat;
|
Bool isfloat;
|
||||||
Bool ismax;
|
|
||||||
Bool *tags;
|
Bool *tags;
|
||||||
Client *next;
|
Client *next;
|
||||||
Client *prev;
|
Client *prev;
|
||||||
@ -73,7 +72,7 @@ extern unsigned int ntags, numlockmask;
|
|||||||
extern void (*handler[LASTEvent])(XEvent *);
|
extern void (*handler[LASTEvent])(XEvent *);
|
||||||
extern void (*arrange)(Arg *);
|
extern void (*arrange)(Arg *);
|
||||||
extern Atom wmatom[WMLast], netatom[NetLast];
|
extern Atom wmatom[WMLast], netatom[NetLast];
|
||||||
extern Bool running, issel, *seltag;
|
extern Bool running, issel, maximized, *seltag;
|
||||||
extern Client *clients, *sel;
|
extern Client *clients, *sel;
|
||||||
extern Cursor cursor[CurLast];
|
extern Cursor cursor[CurLast];
|
||||||
extern DC dc;
|
extern DC dc;
|
||||||
@ -137,4 +136,5 @@ extern void restack();
|
|||||||
extern void togglemode(Arg *arg);
|
extern void togglemode(Arg *arg);
|
||||||
extern void toggleview(Arg *arg);
|
extern void toggleview(Arg *arg);
|
||||||
extern void view(Arg *arg);
|
extern void view(Arg *arg);
|
||||||
|
extern void viewall(Arg *arg);
|
||||||
extern void zoom(Arg *arg);
|
extern void zoom(Arg *arg);
|
||||||
|
127
dwm.html
127
dwm.html
@ -1,127 +0,0 @@
|
|||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>dwm - dynamic window manager</title>
|
|
||||||
<meta name="author" content="Anselm R. Garbe">
|
|
||||||
<meta name="generator" content="ed">
|
|
||||||
<meta name="copyright" content="(C)opyright 2006 by Anselm R. Garbe">
|
|
||||||
<link rel="dwm icon" href="favicon.ico" type="image/x-icon" />
|
|
||||||
<style type="text/css">
|
|
||||||
body {
|
|
||||||
color: #000000;
|
|
||||||
font-family: sans-serif;
|
|
||||||
margin: 20px 20px 20px 20px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<center>
|
|
||||||
<img src="dwm.png"/><br />
|
|
||||||
<h3>dynamic window manager</h3>
|
|
||||||
</center>
|
|
||||||
<h3>Description</h3>
|
|
||||||
<p>
|
|
||||||
dwm is a dynamic window manager for X11.
|
|
||||||
</p>
|
|
||||||
<h4>Background</h4>
|
|
||||||
<p>
|
|
||||||
As founder and main developer of wmii I came to the conclusion that
|
|
||||||
wmii is too clunky for my needs. I don't need so many funky features
|
|
||||||
and all this hype about remote control through a 9P service, I only
|
|
||||||
want to manage my windows in a simple, but dynamic way. wmii never got
|
|
||||||
finished because I listened to users, who proposed arbitrary ideas I
|
|
||||||
considered useful. This resulted in an extreme <a
|
|
||||||
href="http://www.jwz.org/doc/cadt.html">CADT</a> development model,
|
|
||||||
which was a mistake. Thus the philosophy of dwm is simply <i>to fit my
|
|
||||||
needs</i> (maybe yours as well). That's it.
|
|
||||||
</p>
|
|
||||||
<h4>Differences to ion, larswm, and wmii</h4>
|
|
||||||
<p>
|
|
||||||
In contrast to ion, larswm, and wmii, dwm is much smaller, faster and simpler.
|
|
||||||
</p>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
dwm has no Lua integration, no 9P support, no editable
|
|
||||||
tagbars, no shell-based configuration, no remote control, and comes
|
|
||||||
without any additional tools like printing the selection or warping
|
|
||||||
the mouse.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
dwm is only a single binary, it's source code is intended to never
|
|
||||||
exceed 2000 SLOC.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
dwm is based on tagging and dynamic window management (however
|
|
||||||
simpler than ion, wmii or larswm). It manages windows in
|
|
||||||
tiling and floating modes. Either mode can be applied dynamically,
|
|
||||||
depending on the application in use and the task performed.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
dwm doesn't distinguishes between layers, there is no floating or
|
|
||||||
tiled layer. Wether the clients of currently selected tag are in
|
|
||||||
tiled mode or not, you can re-arrange all clients on the fly.
|
|
||||||
Popup- and fixed-size windows are treated floating, however.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
dwm is customized through editing its source code, that makes it
|
|
||||||
extremely fast and secure - it does not process any input data
|
|
||||||
which hasn't been known at compile time, except window title names
|
|
||||||
and status text read from standard input. You don't have to learn
|
|
||||||
Lua/sh/ruby or some weird configuration file format (like X
|
|
||||||
resource files), beside C to customize it for your needs,
|
|
||||||
you <b>only</b> have to learn C (at least editing header files).
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Because dwm is customized through editing its source code, it's
|
|
||||||
pointless to make binary packages of it. This keeps its userbase
|
|
||||||
small and elitist. No novices asking stupid questions.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
dwm uses 1-pixel borders to provide the maximum of screen real
|
|
||||||
estate to clients. Small titlebars are only drawn in front of
|
|
||||||
unfocused clients.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
dwm reads from standard input to print arbitrary status text (like
|
|
||||||
the date, load, battery charge). That's much simpler than
|
|
||||||
larsremote, wmiir and what not...
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
It can be downloaded and distributed under the conditions
|
|
||||||
of the <a href="http://10kloc.org/cgi-bin/hgwebdir.cgi/dwm?f=f10eb1139362;file=LICENSE;style=raw">MIT/X Consortium license</a>.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Optionally you can install <b>dmenu</b> to extend dwm with a wmii-alike menu.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<h4>Links</h4>
|
|
||||||
<ul>
|
|
||||||
<li><a href="http://10kloc.org/cgi-bin/man/man2html?query=dwm">Man page</a></li>
|
|
||||||
<li><a href="http://10kloc.org/shots/dwm-20060810a.png">Screenshot of tiled mode</a> (20060810)</li>
|
|
||||||
<li><a href="http://10kloc.org/shots/dwm-20060810b.png">Screenshotof floating mode</a> (20060810)</li>
|
|
||||||
<li><a href="http://10kloc.org/download/poster.ps">A4 poster (PostScript)</a></li>
|
|
||||||
<li>Mailing List: <a href="http://10kloc.org/cgi-bin/mailman/listinfo/dwm">dwm at wmii dot de</a> <a href="http://10kloc.org/pipermail/dwm/">(Archives)</a> <a href="http://dir.gmane.org/gmane.comp.window-managers.dwm">(GMANE Archive)</a></li>
|
|
||||||
<li>IRC channel: <code>#dwm</code> at <code>irc.oftc.net</code></li>
|
|
||||||
</ul>
|
|
||||||
<h3>Download</h3>
|
|
||||||
<ul>
|
|
||||||
<li><a href="http://10kloc.org/download/dwm-1.2.tar.gz">dwm 1.2</a> (15kb) (20060830)</li>
|
|
||||||
<li><a href="http://10kloc.org/download/dmenu-0.6.tar.gz">dmenu 0.6</a> (7kb) (20060828)</li>
|
|
||||||
</ul>
|
|
||||||
<h3>Development</h3>
|
|
||||||
<p>
|
|
||||||
dwm is actively developed in parallel to wmii. You can <a href="http://10kloc.org/cgi-bin/hgwebdir.cgi/dwm">browse</a> its source code repository or get a copy using <a href="http://www.selenic.com/mercurial/">Mercurial</a> with following command:
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<code>hg clone http://10kloc.org/cgi-bin/hgwebdir.cgi/dwm</code>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<code>hg clone http://10kloc.org/cgi-bin/hgwebdir.cgi/dmenu</code>
|
|
||||||
</p>
|
|
||||||
<h3>Miscellaneous</h3>
|
|
||||||
<p>
|
|
||||||
You can purchase this <a href="https://www.spreadshirt.net/shop.php?op=article&article_id=3298632&view=403">tricot</a>
|
|
||||||
if you like dwm and the dwm logo, which has been designed by Anselm.
|
|
||||||
</p>
|
|
||||||
<p><small>--Anselm</small></p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
45
event.c
45
event.c
@ -109,10 +109,18 @@ buttonpress(XEvent *e)
|
|||||||
for(a.i = 0; a.i < ntags; a.i++) {
|
for(a.i = 0; a.i < ntags; a.i++) {
|
||||||
x += textw(tags[a.i]);
|
x += textw(tags[a.i]);
|
||||||
if(ev->x < x) {
|
if(ev->x < x) {
|
||||||
if(ev->button == Button1)
|
if(ev->button == Button1) {
|
||||||
view(&a);
|
if(ev->state & MODKEY)
|
||||||
else if(ev->button == Button3)
|
tag(&a);
|
||||||
toggleview(&a);
|
else
|
||||||
|
view(&a);
|
||||||
|
}
|
||||||
|
else if(ev->button == Button3) {
|
||||||
|
if(ev->state & MODKEY)
|
||||||
|
toggletag(&a);
|
||||||
|
else
|
||||||
|
toggleview(&a);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -123,26 +131,17 @@ buttonpress(XEvent *e)
|
|||||||
}
|
}
|
||||||
else if((c = getclient(ev->window))) {
|
else if((c = getclient(ev->window))) {
|
||||||
focus(c);
|
focus(c);
|
||||||
if(CLEANMASK(ev->state) != MODKEY)
|
if(maximized || CLEANMASK(ev->state) != MODKEY)
|
||||||
return;
|
return;
|
||||||
switch(ev->button) {
|
if(ev->button == Button1 && (arrange == dofloat || c->isfloat)) {
|
||||||
default:
|
restack(c);
|
||||||
break;
|
movemouse(c);
|
||||||
case Button1:
|
}
|
||||||
if(!c->ismax && (arrange == dofloat || c->isfloat)) {
|
else if(ev->button == Button2)
|
||||||
restack(c);
|
|
||||||
movemouse(c);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Button2:
|
|
||||||
zoom(NULL);
|
zoom(NULL);
|
||||||
break;
|
else if(ev->button == Button3 && (arrange == dofloat || c->isfloat)) {
|
||||||
case Button3:
|
restack(c);
|
||||||
if(!c->ismax && (arrange == dofloat || c->isfloat)) {
|
resizemouse(c);
|
||||||
restack(c);
|
|
||||||
resizemouse(c);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -174,7 +173,7 @@ configurerequest(XEvent *e)
|
|||||||
XWindowChanges wc;
|
XWindowChanges wc;
|
||||||
|
|
||||||
if((c = getclient(ev->window))) {
|
if((c = getclient(ev->window))) {
|
||||||
if(!c->isfloat && (arrange != dofloat) && c->ismax) {
|
if((c == sel) && !c->isfloat && (arrange != dofloat) && maximized) {
|
||||||
synconfig(c, sx, sy + bh, sw - 2, sh - 2 - bh, ev->border_width);
|
synconfig(c, sx, sy + bh, sw - 2, sh - 2 - bh, ev->border_width);
|
||||||
XSync(dpy, False);
|
XSync(dpy, False);
|
||||||
return;
|
return;
|
||||||
|
BIN
favicon.ico
BIN
favicon.ico
Binary file not shown.
Before Width: | Height: | Size: 198 B |
1
main.c
1
main.c
@ -24,6 +24,7 @@ unsigned int ntags, numlockmask;
|
|||||||
Atom wmatom[WMLast], netatom[NetLast];
|
Atom wmatom[WMLast], netatom[NetLast];
|
||||||
Bool running = True;
|
Bool running = True;
|
||||||
Bool issel = True;
|
Bool issel = True;
|
||||||
|
Bool maximized = False;
|
||||||
Client *clients = NULL;
|
Client *clients = NULL;
|
||||||
Client *sel = NULL;
|
Client *sel = NULL;
|
||||||
Cursor cursor[CurLast];
|
Cursor cursor[CurLast];
|
||||||
|
15
tag.c
15
tag.c
@ -30,17 +30,6 @@ RULES
|
|||||||
static RReg *rreg = NULL;
|
static RReg *rreg = NULL;
|
||||||
static unsigned int len = 0;
|
static unsigned int len = 0;
|
||||||
|
|
||||||
static void
|
|
||||||
commit()
|
|
||||||
{
|
|
||||||
/* asserts sel != NULL */
|
|
||||||
settitle(sel);
|
|
||||||
if(!isvisible(sel))
|
|
||||||
arrange(NULL);
|
|
||||||
else
|
|
||||||
drawstatus();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* extern */
|
/* extern */
|
||||||
|
|
||||||
Client *
|
Client *
|
||||||
@ -132,7 +121,7 @@ tag(Arg *arg)
|
|||||||
for(i = 0; i < ntags; i++)
|
for(i = 0; i < ntags; i++)
|
||||||
sel->tags[i] = False;
|
sel->tags[i] = False;
|
||||||
sel->tags[arg->i] = True;
|
sel->tags[arg->i] = True;
|
||||||
commit();
|
arrange(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -147,5 +136,5 @@ toggletag(Arg *arg)
|
|||||||
for(i = 0; i < ntags && !sel->tags[i]; i++);
|
for(i = 0; i < ntags && !sel->tags[i]; i++);
|
||||||
if(i == ntags)
|
if(i == ntags)
|
||||||
sel->tags[arg->i] = True;
|
sel->tags[arg->i] = True;
|
||||||
commit();
|
arrange(NULL);
|
||||||
}
|
}
|
||||||
|
31
view.c
31
view.c
@ -59,18 +59,17 @@ dofloat(Arg *arg)
|
|||||||
{
|
{
|
||||||
Client *c;
|
Client *c;
|
||||||
|
|
||||||
|
maximized = False;
|
||||||
|
|
||||||
for(c = clients; c; c = c->next) {
|
for(c = clients; c; c = c->next) {
|
||||||
c->ismax = False;
|
|
||||||
if(isvisible(c)) {
|
if(isvisible(c)) {
|
||||||
resize(c, True, TopLeft);
|
resize(c, True, TopLeft);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ban(c);
|
ban(c);
|
||||||
}
|
}
|
||||||
if((sel = getnext(clients)))
|
if(!sel || !isvisible(sel))
|
||||||
focus(sel);
|
focus(getnext(clients));
|
||||||
else
|
|
||||||
XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
|
|
||||||
restack();
|
restack();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,6 +79,8 @@ dotile(Arg *arg)
|
|||||||
int h, i, n, w;
|
int h, i, n, w;
|
||||||
Client *c;
|
Client *c;
|
||||||
|
|
||||||
|
maximized = False;
|
||||||
|
|
||||||
w = sw - mw;
|
w = sw - mw;
|
||||||
for(n = 0, c = clients; c; c = c->next)
|
for(n = 0, c = clients; c; c = c->next)
|
||||||
if(isvisible(c) && !c->isfloat)
|
if(isvisible(c) && !c->isfloat)
|
||||||
@ -91,7 +92,6 @@ dotile(Arg *arg)
|
|||||||
h = sh - bh;
|
h = sh - bh;
|
||||||
|
|
||||||
for(i = 0, c = clients; c; c = c->next) {
|
for(i = 0, c = clients; c; c = c->next) {
|
||||||
c->ismax = False;
|
|
||||||
if(isvisible(c)) {
|
if(isvisible(c)) {
|
||||||
if(c->isfloat) {
|
if(c->isfloat) {
|
||||||
resize(c, True, TopLeft);
|
resize(c, True, TopLeft);
|
||||||
@ -130,10 +130,8 @@ dotile(Arg *arg)
|
|||||||
else
|
else
|
||||||
ban(c);
|
ban(c);
|
||||||
}
|
}
|
||||||
if((sel = getnext(clients)))
|
if(!sel || !isvisible(sel))
|
||||||
focus(sel);
|
focus(getnext(clients));
|
||||||
else
|
|
||||||
XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
|
|
||||||
restack();
|
restack();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -269,12 +267,23 @@ view(Arg *arg)
|
|||||||
arrange(NULL);
|
arrange(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
viewall(Arg *arg)
|
||||||
|
{
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
|
for(i = 0; i < ntags; i++)
|
||||||
|
seltag[i] = True;
|
||||||
|
reorder();
|
||||||
|
arrange(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
zoom(Arg *arg)
|
zoom(Arg *arg)
|
||||||
{
|
{
|
||||||
Client *c = sel;
|
Client *c = sel;
|
||||||
|
|
||||||
if(!c || (arrange != dotile) || c->isfloat || c->ismax)
|
if(!c || (arrange != dotile) || c->isfloat || maximized)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(c == getnext(clients))
|
if(c == getnext(clients))
|
||||||
|
Reference in New Issue
Block a user