Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
22399a3bc0 | |||
ad2508f957 | |||
b078599833 | |||
1e80207876 | |||
464fc2cd18 | |||
be8d6d40f6 | |||
f0c2353393 | |||
a730213c3b | |||
399993c6b5 | |||
4d318060a2 | |||
540d5eed46 | |||
7d071ce2bd |
1
.hgtags
1
.hgtags
@ -41,3 +41,4 @@ d3876aa792923f9a95f7ad0c7f0134533404df35 3.2.2
|
||||
20ec6976cee1fcfee0c2f354ae382ee3f9f68efa 3.6.1
|
||||
baee494346e520f8dee2cee9491b8350064770d2 3.7
|
||||
2ea201354cf016407ea93e1e390d1422940d29b0 3.8
|
||||
55478328b2422c700c5404a774c85e77322f41a3 3.9
|
||||
|
4
LICENSE
4
LICENSE
@ -1,7 +1,7 @@
|
||||
MIT/X Consortium License
|
||||
|
||||
(C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||
(C)opyright MMVI-MMVII Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||
© 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
|
||||
© 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
|
2
Makefile
2
Makefile
@ -1,5 +1,5 @@
|
||||
# dwm - dynamic window manager
|
||||
# (C)opyright MMVI-MMVII Anselm R. Garbe
|
||||
# © 2006-2007 Anselm R. Garbe, Sander van Dijk
|
||||
|
||||
include config.mk
|
||||
|
||||
|
35
client.c
35
client.c
@ -1,6 +1,6 @@
|
||||
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||
* See LICENSE file for license details.
|
||||
*/
|
||||
/* © 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
|
||||
* © 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||
* See LICENSE file for license details. */
|
||||
#include "dwm.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@ -173,8 +173,9 @@ killclient(const char *arg) {
|
||||
|
||||
void
|
||||
manage(Window w, XWindowAttributes *wa) {
|
||||
Client *c, *t;
|
||||
Client *c, *t = NULL;
|
||||
Window trans;
|
||||
Status rettrans;
|
||||
XWindowChanges wc;
|
||||
|
||||
c = emallocz(sizeof(Client));
|
||||
@ -184,13 +185,13 @@ manage(Window w, XWindowAttributes *wa) {
|
||||
c->y = wa->y;
|
||||
c->w = wa->width;
|
||||
c->h = wa->height;
|
||||
c->oldborder = wa->border_width;
|
||||
if(c->w == sw && c->h == sh) {
|
||||
c->border = 0;
|
||||
c->x = sx;
|
||||
c->y = sy;
|
||||
c->border = wa->border_width;
|
||||
}
|
||||
else {
|
||||
c->border = BORDERPX;
|
||||
if(c->x + c->w + 2 * c->border > wax + waw)
|
||||
c->x = wax + waw - c->w - 2 * c->border;
|
||||
if(c->y + c->h + 2 * c->border > way + wah)
|
||||
@ -199,21 +200,22 @@ manage(Window w, XWindowAttributes *wa) {
|
||||
c->x = wax;
|
||||
if(c->y < way)
|
||||
c->y = way;
|
||||
c->border = BORDERPX;
|
||||
}
|
||||
updatesizehints(c);
|
||||
XSelectInput(dpy, w,
|
||||
StructureNotifyMask | PropertyChangeMask | EnterWindowMask);
|
||||
XGetTransientForHint(dpy, w, &trans);
|
||||
grabbuttons(c, False);
|
||||
wc.border_width = c->border;
|
||||
XConfigureWindow(dpy, w, CWBorderWidth, &wc);
|
||||
XSetWindowBorder(dpy, w, dc.norm[ColBorder]);
|
||||
configure(c); /* propagates border_width, if size doesn't change */
|
||||
updatesizehints(c);
|
||||
XSelectInput(dpy, w,
|
||||
StructureNotifyMask | PropertyChangeMask | EnterWindowMask);
|
||||
grabbuttons(c, False);
|
||||
updatetitle(c);
|
||||
for(t = clients; t && t->win != trans; t = t->next);
|
||||
if((rettrans = XGetTransientForHint(dpy, w, &trans) == Success))
|
||||
for(t = clients; t && t->win != trans; t = t->next);
|
||||
settags(c, t);
|
||||
if(!c->isfloating)
|
||||
c->isfloating = (t != NULL) || c->isfixed;
|
||||
c->isfloating = (rettrans == Success) || c->isfixed;
|
||||
attach(c);
|
||||
attachstack(c);
|
||||
c->isbanned = True;
|
||||
@ -269,10 +271,6 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
|
||||
}
|
||||
if(w <= 0 || h <= 0)
|
||||
return;
|
||||
if(w == sw && h == sh)
|
||||
c->border = 0;
|
||||
else
|
||||
c->border = BORDERPX;
|
||||
/* offscreen appearance fixes */
|
||||
if(x > sw)
|
||||
x = sw - w - 2 * c->border;
|
||||
@ -383,10 +381,13 @@ updatetitle(Client *c) {
|
||||
void
|
||||
unmanage(Client *c) {
|
||||
Client *nc;
|
||||
XWindowChanges wc;
|
||||
|
||||
wc.border_width = c->oldborder;
|
||||
/* The server grab construct avoids race conditions. */
|
||||
XGrabServer(dpy);
|
||||
XSetErrorHandler(xerrordummy);
|
||||
XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore border */
|
||||
detach(c);
|
||||
detachstack(c);
|
||||
if(sel == c) {
|
||||
|
@ -1,10 +1,10 @@
|
||||
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||
* See LICENSE file for license details.
|
||||
*/
|
||||
/* © 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
|
||||
* © 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||
* See LICENSE file for license details. */
|
||||
|
||||
/* appearance */
|
||||
#define BORDERPX 1
|
||||
#define FONT "-*-proggyclean-medium-r-*-*-13-*-*-*-*-*-*-*"
|
||||
#define FONT "-*-pixelcarnage monospace-*-r-*-*-14-*-*-*-*-*-*-*"
|
||||
#define NORMBORDERCOLOR "#333"
|
||||
#define NORMBGCOLOR "#222"
|
||||
#define NORMFGCOLOR "#ccc"
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||
* See LICENSE file for license details.
|
||||
*/
|
||||
/* © 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
|
||||
* © 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||
* See LICENSE file for license details. */
|
||||
|
||||
/* appearance */
|
||||
#define BORDERPX 1
|
||||
|
@ -1,5 +1,5 @@
|
||||
# dwm version
|
||||
VERSION = 3.9
|
||||
VERSION = 4.0
|
||||
|
||||
# Customize below to fit your system
|
||||
|
||||
|
6
draw.c
6
draw.c
@ -1,6 +1,6 @@
|
||||
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||
* See LICENSE file for license details.
|
||||
*/
|
||||
/* © 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
|
||||
* © 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||
* See LICENSE file for license details. */
|
||||
#include "dwm.h"
|
||||
#include <string.h>
|
||||
|
||||
|
5
dwm.h
5
dwm.h
@ -1,4 +1,5 @@
|
||||
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||
/* © 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
|
||||
* © 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||
* See LICENSE file for license details.
|
||||
*
|
||||
* dynamic window manager is designed like any other X client as well. It is
|
||||
@ -49,7 +50,7 @@ struct Client {
|
||||
int basew, baseh, incw, inch, maxw, maxh, minw, minh;
|
||||
int minax, maxax, minay, maxay;
|
||||
long flags;
|
||||
unsigned int border;
|
||||
unsigned int border, oldborder;
|
||||
Bool isbanned, isfixed, ismax, isfloating;
|
||||
Bool *tags;
|
||||
Client *next;
|
||||
|
6
event.c
6
event.c
@ -1,6 +1,6 @@
|
||||
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||
* See LICENSE file for license details.
|
||||
*/
|
||||
/* © 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
|
||||
* © 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||
* See LICENSE file for license details. */
|
||||
#include "dwm.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
22
layout.c
22
layout.c
@ -1,6 +1,6 @@
|
||||
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||
* See LICENSE file for license details.
|
||||
*/
|
||||
/* © 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
|
||||
* © 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||
* See LICENSE file for license details. */
|
||||
#include "dwm.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
@ -38,18 +38,18 @@ tile(void) {
|
||||
ny = way;
|
||||
if(i < nmaster) {
|
||||
ny += i * mh;
|
||||
nw = mw - 2 * BORDERPX;
|
||||
nh = mh - 2 * BORDERPX;
|
||||
nw = mw - 2 * c->border;
|
||||
nh = mh - 2 * c->border;
|
||||
}
|
||||
else { /* tile window */
|
||||
nx += mw;
|
||||
nw = tw - 2 * BORDERPX;
|
||||
if(th > 2 * BORDERPX) {
|
||||
nw = tw - 2 * c->border;
|
||||
if(th > 2 * c->border) {
|
||||
ny += (i - nmaster) * th;
|
||||
nh = th - 2 * BORDERPX;
|
||||
nh = th - 2 * c->border;
|
||||
}
|
||||
else /* fallback if th <= 2 * BORDERPX */
|
||||
nh = wah - 2 * BORDERPX;
|
||||
else /* fallback if th <= 2 * c->border */
|
||||
nh = wah - 2 * c->border;
|
||||
}
|
||||
resize(c, nx, ny, nw, nh, False);
|
||||
i++;
|
||||
@ -125,7 +125,7 @@ incmasterw(const char *arg) {
|
||||
masterw = MASTERWIDTH;
|
||||
else {
|
||||
i = atoi(arg);
|
||||
if(waw * (masterw + i) / 1000 >= waw - 2 * BORDERPX
|
||||
if(waw * (masterw + i) / 1000 >= waw - 2 * BORDERPX
|
||||
|| waw * (masterw + i) / 1000 <= 2 * BORDERPX)
|
||||
return;
|
||||
masterw += i;
|
||||
|
11
main.c
11
main.c
@ -1,7 +1,6 @@
|
||||
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||
* See LICENSE file for license details.
|
||||
*/
|
||||
|
||||
/* © 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
|
||||
* © 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||
* See LICENSE file for license details. */
|
||||
#include "dwm.h"
|
||||
#include <errno.h>
|
||||
#include <locale.h>
|
||||
@ -82,7 +81,7 @@ initfont(const char *fontstr) {
|
||||
dc.font.set = XCreateFontSet(dpy, fontstr, &missing, &n, &def);
|
||||
if(missing) {
|
||||
while(n--)
|
||||
fprintf(stderr, "missing fontset: %s\n", missing[n]);
|
||||
fprintf(stderr, "dwm: missing fontset: %s\n", missing[n]);
|
||||
XFreeStringList(missing);
|
||||
}
|
||||
if(dc.font.set) {
|
||||
@ -256,7 +255,7 @@ main(int argc, char *argv[]) {
|
||||
XEvent ev;
|
||||
|
||||
if(argc == 2 && !strncmp("-v", argv[1], 3))
|
||||
eprint("dwm-"VERSION", (C)opyright MMVI-MMVII Anselm R. Garbe\n");
|
||||
eprint("dwm-"VERSION", © 2004-2007 Anselm R. Garbe, Sander van Dijk\n");
|
||||
else if(argc != 1)
|
||||
eprint("usage: dwm [-v]\n");
|
||||
setlocale(LC_CTYPE, "");
|
||||
|
6
tag.c
6
tag.c
@ -1,6 +1,6 @@
|
||||
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||
* See LICENSE file for license details.
|
||||
*/
|
||||
/* © 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
|
||||
* © 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||
* See LICENSE file for license details. */
|
||||
#include "dwm.h"
|
||||
#include <regex.h>
|
||||
#include <stdio.h>
|
||||
|
6
util.c
6
util.c
@ -1,6 +1,6 @@
|
||||
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||
* See LICENSE file for license details.
|
||||
*/
|
||||
/* © 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
|
||||
* © 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||
* See LICENSE file for license details. */
|
||||
#include "dwm.h"
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
Reference in New Issue
Block a user