Compare commits
20 Commits
Author | SHA1 | Date | |
---|---|---|---|
ee734fae6b | |||
62d3caa999 | |||
4c9b397ff9 | |||
5c6545adf5 | |||
a704b1ee34 | |||
f83d61dfe8 | |||
c6180949a7 | |||
1973ab0643 | |||
427053f8d1 | |||
a88e0373ef | |||
aa9f2be24e | |||
c53b29e60b | |||
d6bdd03d91 | |||
1144e98394 | |||
7671d03a90 | |||
bc554d45d8 | |||
ac4caea921 | |||
161f2d921b | |||
210378f198 | |||
7879616a75 |
4
.hgtags
4
.hgtags
@ -64,3 +64,7 @@ deaa276abac17ca08fbeb936916e4c8292d293a4 5.5
|
||||
5550702215773aad462f22a774dced9b87437c51 5.6
|
||||
e47a47bd3ed42fd3cf023572147b75ebc2adef82 5.6.1
|
||||
257403d4cd962cac03344a871ea56cc742bae38e 5.7
|
||||
48c3f87c335d6606e55fbae97267fa6b39ca56e0 5.7.1
|
||||
15761ac5e2f1e9010900f891616a24a22d82f128 5.7.2
|
||||
60ea8fed13ab750c6717f2764cbf9c13bb6f0d0a 5.8
|
||||
1ed1e75c9c2e395a2c475b52657a430bd95070c7 5.8.1
|
||||
|
97
BUGS
Normal file
97
BUGS
Normal file
@ -0,0 +1,97 @@
|
||||
---
|
||||
|
||||
18:17 < Biolunar> when i change my resolution in dwm (to a smaller one) and then back to the native, the top bar is not repainted. that's since 5.7.2, in 5.6 it worked fine
|
||||
18:19 < Biolunar> is it just happening to me or a (known) bug?
|
||||
18:24 < Biolunar> and in addition, mplayers fullscreen is limited to the small resolution after i changed it back to the native
|
||||
|
||||
reproducible with xrandr -s but not with --output and --mode, strange
|
||||
|
||||
---
|
||||
|
||||
> enternotify is handled even when the entered window is already focused
|
||||
> (eg moving the mouse to the bar and back, scrolling on the border..)
|
||||
>
|
||||
> focusing might be expensive for some clients (eg dim/light up)
|
||||
>
|
||||
> a possible solution is to modify enternotify:
|
||||
>
|
||||
> + c = wintoclient(ev->window);
|
||||
> if((m = wintomon(ev->window)) && m != selmon) {
|
||||
> unfocus(selmon->sel);
|
||||
> selmon = m;
|
||||
> }
|
||||
> + else if (c == selmon->sel || c == NULL)
|
||||
> + return;
|
||||
|
||||
---
|
||||
|
||||
> another corner case:
|
||||
|
||||
a tiled client can be resized with mod+right click, but it only works
|
||||
on the main monitor
|
||||
|
||||
---
|
||||
|
||||
dmenu appears on the monitor where the pointer is and not on selmon
|
||||
|
||||
---
|
||||
|
||||
yet another corner case:
|
||||
open a terminal, focus another monitor, but without moving the mouse
|
||||
pointer there
|
||||
if there is no client on the other monitor to get the focus, then the
|
||||
terminal will be unfocused but it will accept input
|
||||
|
||||
---
|
||||
|
||||
Donald Allen reported this:
|
||||
|
||||
starting emacs from dmenu in archlinux results in missing configure of emacs, but mod1-space or mod1-shift-space fix this problem. this problem is new and did not happen in 1.6 xorg servers
|
||||
|
||||
Starting emacs from xterm doesnt show this problem, he uses tag 8 for emacs
|
||||
|
||||
---
|
||||
|
||||
2009/12/7 Alexandr Krylovskiy <wing_AT_tversu.ru>:
|
||||
> Fullscreen mode with flash applications (youtube, for example) doesn't
|
||||
> work properly neither in tiled nor in floating mode.
|
||||
> Fullscreen window closes immediately after opening.
|
||||
|
||||
This is a known bug (for some curiosity I received the same report via
|
||||
privmail from 2 other people within one week, really strange).
|
||||
The quick fix is commenting out the code in lines 817/818 in hg tip
|
||||
dwm. I cannot confirm this has no side effects (I think it does) and I
|
||||
will address this issue shortly with a real fix.
|
||||
|
||||
---
|
||||
|
||||
SDL seems to not like non-reparenting WMs:
|
||||
|
||||
> I would like to mention SDL problems, however SDL is not crucial to
|
||||
> me anymore; people that really care about it should speak up and
|
||||
> propose dwm / SDL patch or cooperation scheme in that matter.
|
||||
|
||||
Patching SDL, bugging them?
|
||||
|
||||
---
|
||||
|
||||
voltaic reports this:
|
||||
|
||||
When I use two monitors, one larger in resolution than the other, the
|
||||
bar is drawn using the smaller x-dimension on both screens. I think
|
||||
what's happening is that there are two bars drawn, but the short bar
|
||||
is always on top of the long bar such that I can't see the information
|
||||
under the short bar. If I switch to the small screen, hide the short
|
||||
bar, and then switch to the large screen, the long bar is drawn
|
||||
correctly.
|
||||
|
||||
A similar problem occurs when I have started dwm on a small resolution
|
||||
monitor (laptop screen) and then I switch to a large external display.
|
||||
When I do this, the bar itself is drawn for the original smaller
|
||||
resolution, but the information to be printed on the bar is
|
||||
right-aligned for a longer bar. So what I see is a bar that has the
|
||||
right hand side of it cut-off. See attached screenshot.
|
||||
|
||||
I am using standard options for xrandr such as --output VGA1 --auto, etc.
|
||||
|
||||
---
|
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
||||
MIT/X Consortium License
|
||||
|
||||
© 2006-2009 Anselm R Garbe <garbeam at gmail dot com>
|
||||
© 2006-2010 Anselm R Garbe <anselm@garbe.us>
|
||||
© 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||
© 2006-2009 Jukka Salmi <jukka at salmi dot ch>
|
||||
© 2007-2009 Premysl Hruby <dfenze at gmail dot com>
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
/* appearance */
|
||||
static const char font[] = "-*-*-medium-*-*-*-14-*-*-*-*-*-*-*";
|
||||
static const char font[] = "-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*";
|
||||
static const char normbordercolor[] = "#cccccc";
|
||||
static const char normbgcolor[] = "#cccccc";
|
||||
static const char normfgcolor[] = "#000000";
|
||||
|
12
config.mk
12
config.mk
@ -1,5 +1,5 @@
|
||||
# dwm version
|
||||
VERSION = 5.7.1
|
||||
VERSION = 5.8.2
|
||||
|
||||
# Customize below to fit your system
|
||||
|
||||
@ -10,7 +10,7 @@ MANPREFIX = ${PREFIX}/share/man
|
||||
X11INC = /usr/X11R6/include
|
||||
X11LIB = /usr/X11R6/lib
|
||||
|
||||
# Xinerama, un-comment if you want it
|
||||
# Xinerama
|
||||
XINERAMALIBS = -L${X11LIB} -lXinerama
|
||||
XINERAMAFLAGS = -DXINERAMA
|
||||
|
||||
@ -20,10 +20,10 @@ LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 ${XINERAMALIBS}
|
||||
|
||||
# flags
|
||||
CPPFLAGS = -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
|
||||
#CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS}
|
||||
CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
|
||||
#LDFLAGS = -g ${LIBS}
|
||||
LDFLAGS = -s ${LIBS}
|
||||
CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS}
|
||||
#CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
|
||||
LDFLAGS = -g ${LIBS}
|
||||
#LDFLAGS = -s ${LIBS}
|
||||
|
||||
# Solaris
|
||||
#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\"
|
||||
|
108
dwm.c
108
dwm.c
@ -57,7 +57,8 @@
|
||||
/* enums */
|
||||
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
|
||||
enum { ColBorder, ColFG, ColBG, ColLast }; /* color */
|
||||
enum { NetSupported, NetWMName, NetLast }; /* EWMH atoms */
|
||||
enum { NetSupported, NetWMName, NetWMState,
|
||||
NetWMFullscreen, NetLast }; /* EWMH atoms */
|
||||
enum { WMProtocols, WMDelete, WMState, WMLast }; /* default atoms */
|
||||
enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
|
||||
ClkClientWin, ClkRootWin, ClkLast }; /* clicks */
|
||||
@ -83,10 +84,11 @@ struct Client {
|
||||
char name[256];
|
||||
float mina, maxa;
|
||||
int x, y, w, h;
|
||||
int oldx, oldy, oldw, oldh;
|
||||
int basew, baseh, incw, inch, maxw, maxh, minw, minh;
|
||||
int bw, oldbw;
|
||||
unsigned int tags;
|
||||
Bool isfixed, isfloating, isurgent;
|
||||
Bool isfixed, isfloating, isurgent, oldstate;
|
||||
Client *next;
|
||||
Client *snext;
|
||||
Monitor *mon;
|
||||
@ -161,6 +163,7 @@ static void checkotherwm(void);
|
||||
static void cleanup(void);
|
||||
static void cleanupmon(Monitor *mon);
|
||||
static void clearurgent(Client *c);
|
||||
static void clientmessage(XEvent *e);
|
||||
static void configure(Client *c);
|
||||
static void configurenotify(XEvent *e);
|
||||
static void configurerequest(XEvent *e);
|
||||
@ -200,6 +203,7 @@ static Monitor *ptrtomon(int x, int y);
|
||||
static void propertynotify(XEvent *e);
|
||||
static void quit(const Arg *arg);
|
||||
static void resize(Client *c, int x, int y, int w, int h, Bool interact);
|
||||
static void resizeclient(Client *c, int x, int y, int w, int h);
|
||||
static void resizemouse(const Arg *arg);
|
||||
static void restack(Monitor *m);
|
||||
static void run(void);
|
||||
@ -220,7 +224,7 @@ static void togglebar(const Arg *arg);
|
||||
static void togglefloating(const Arg *arg);
|
||||
static void toggletag(const Arg *arg);
|
||||
static void toggleview(const Arg *arg);
|
||||
static void unfocus(Client *c);
|
||||
static void unfocus(Client *c, Bool setfocus);
|
||||
static void unmanage(Client *c, Bool destroyed);
|
||||
static void unmapnotify(XEvent *e);
|
||||
static Bool updategeom(void);
|
||||
@ -249,6 +253,7 @@ static int (*xerrorxlib)(Display *, XErrorEvent *);
|
||||
static unsigned int numlockmask = 0;
|
||||
static void (*handler[LASTEvent]) (XEvent *) = {
|
||||
[ButtonPress] = buttonpress,
|
||||
[ClientMessage] = clientmessage,
|
||||
[ConfigureRequest] = configurerequest,
|
||||
[ConfigureNotify] = configurenotify,
|
||||
[DestroyNotify] = destroynotify,
|
||||
@ -423,7 +428,7 @@ buttonpress(XEvent *e) {
|
||||
click = ClkRootWin;
|
||||
/* focus monitor if necessary */
|
||||
if((m = wintomon(ev->window)) && m != selmon) {
|
||||
unfocus(selmon->sel);
|
||||
unfocus(selmon->sel, True);
|
||||
selmon = m;
|
||||
focus(NULL);
|
||||
}
|
||||
@ -792,7 +797,7 @@ enternotify(XEvent *e) {
|
||||
if((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root)
|
||||
return;
|
||||
if((m = wintomon(ev->window)) && m != selmon) {
|
||||
unfocus(selmon->sel);
|
||||
unfocus(selmon->sel, True);
|
||||
selmon = m;
|
||||
}
|
||||
if((c = wintoclient(ev->window)))
|
||||
@ -814,8 +819,9 @@ void
|
||||
focus(Client *c) {
|
||||
if(!c || !ISVISIBLE(c))
|
||||
for(c = selmon->stack; c && !ISVISIBLE(c); c = c->snext);
|
||||
if(selmon->sel)
|
||||
unfocus(selmon->sel);
|
||||
/* was if(selmon->sel) */
|
||||
if(selmon->sel && selmon->sel != c)
|
||||
unfocus(selmon->sel, False);
|
||||
if(c) {
|
||||
if(c->mon != selmon)
|
||||
selmon = c->mon;
|
||||
@ -847,8 +853,9 @@ focusmon(const Arg *arg) {
|
||||
|
||||
if(!mons->next)
|
||||
return;
|
||||
m = dirtomon(arg->i);
|
||||
unfocus(selmon->sel);
|
||||
if((m = dirtomon(arg->i)) == selmon)
|
||||
return;
|
||||
unfocus(selmon->sel, True);
|
||||
selmon = m;
|
||||
focus(NULL);
|
||||
}
|
||||
@ -900,15 +907,14 @@ getrootptr(int *x, int *y) {
|
||||
|
||||
long
|
||||
getstate(Window w) {
|
||||
int format, status;
|
||||
int format;
|
||||
long result = -1;
|
||||
unsigned char *p = NULL;
|
||||
unsigned long n, extra;
|
||||
Atom real;
|
||||
|
||||
status = XGetWindowProperty(dpy, w, wmatom[WMState], 0L, 2L, False, wmatom[WMState],
|
||||
&real, &format, &n, &extra, (unsigned char **)&p);
|
||||
if(status != Success)
|
||||
if(XGetWindowProperty(dpy, w, wmatom[WMState], 0L, 2L, False, wmatom[WMState],
|
||||
&real, &format, &n, &extra, (unsigned char **)&p) != Success)
|
||||
return -1;
|
||||
if(n != 0)
|
||||
result = *p;
|
||||
@ -1109,12 +1115,13 @@ manage(Window w, XWindowAttributes *wa) {
|
||||
applyrules(c);
|
||||
}
|
||||
/* geometry */
|
||||
c->x = wa->x + c->mon->wx;
|
||||
c->y = wa->y + c->mon->wy;
|
||||
c->w = wa->width;
|
||||
c->h = wa->height;
|
||||
c->x = c->oldx = wa->x + c->mon->wx;
|
||||
c->y = c->oldy = wa->y + c->mon->wy;
|
||||
c->w = c->oldw = wa->width;
|
||||
c->h = c->oldh = wa->height;
|
||||
c->oldbw = wa->border_width;
|
||||
if(c->w == c->mon->mw && c->h == c->mon->mh) {
|
||||
c->isfloating = 1;
|
||||
c->x = c->mon->mx;
|
||||
c->y = c->mon->my;
|
||||
c->bw = 0;
|
||||
@ -1138,7 +1145,7 @@ manage(Window w, XWindowAttributes *wa) {
|
||||
XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask);
|
||||
grabbuttons(c, False);
|
||||
if(!c->isfloating)
|
||||
c->isfloating = trans != None || c->isfixed;
|
||||
c->isfloating = c->oldstate = trans != None || c->isfixed;
|
||||
if(c->isfloating)
|
||||
XRaiseWindow(dpy, c->win);
|
||||
attach(c);
|
||||
@ -1290,6 +1297,39 @@ propertynotify(XEvent *e) {
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
clientmessage(XEvent *e) {
|
||||
XClientMessageEvent *cme = &e->xclient;
|
||||
Client *c;
|
||||
|
||||
if((c = wintoclient(cme->window))
|
||||
&& (cme->message_type == netatom[NetWMState] && cme->data.l[1] == netatom[NetWMFullscreen]))
|
||||
{
|
||||
if(cme->data.l[0]) {
|
||||
XChangeProperty(dpy, cme->window, netatom[NetWMState], XA_ATOM, 32,
|
||||
PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1);
|
||||
c->oldstate = c->isfloating;
|
||||
c->oldbw = c->bw;
|
||||
c->bw = 0;
|
||||
c->isfloating = 1;
|
||||
resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh);
|
||||
XRaiseWindow(dpy, c->win);
|
||||
}
|
||||
else {
|
||||
XChangeProperty(dpy, cme->window, netatom[NetWMState], XA_ATOM, 32,
|
||||
PropModeReplace, (unsigned char*)0, 0);
|
||||
c->isfloating = c->oldstate;
|
||||
c->bw = c->oldbw;
|
||||
c->x = c->oldx;
|
||||
c->y = c->oldy;
|
||||
c->w = c->oldw;
|
||||
c->h = c->oldh;
|
||||
resizeclient(c, c->x, c->y, c->w, c->h);
|
||||
arrange(c->mon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
quit(const Arg *arg) {
|
||||
running = False;
|
||||
@ -1297,19 +1337,23 @@ quit(const Arg *arg) {
|
||||
|
||||
void
|
||||
resize(Client *c, int x, int y, int w, int h, Bool interact) {
|
||||
if(applysizehints(c, &x, &y, &w, &h, interact))
|
||||
resizeclient(c, x, y, w, h);
|
||||
}
|
||||
|
||||
void
|
||||
resizeclient(Client *c, int x, int y, int w, int h) {
|
||||
XWindowChanges wc;
|
||||
|
||||
if(applysizehints(c, &x, &y, &w, &h, interact)) {
|
||||
c->x = wc.x = x;
|
||||
c->y = wc.y = y;
|
||||
c->w = wc.width = w;
|
||||
c->h = wc.height = h;
|
||||
c->oldx = c->x; c->x = wc.x = x;
|
||||
c->oldy = c->y; c->y = wc.y = y;
|
||||
c->oldw = c->w; c->w = wc.width = w;
|
||||
c->oldh = c->h; c->h = wc.height = h;
|
||||
wc.border_width = c->bw;
|
||||
XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
|
||||
configure(c);
|
||||
XSync(dpy, False);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
resizemouse(const Arg *arg) {
|
||||
@ -1388,13 +1432,13 @@ restack(Monitor *m) {
|
||||
void
|
||||
run(void) {
|
||||
XEvent ev;
|
||||
|
||||
/* main event loop */
|
||||
XSync(dpy, False);
|
||||
while(running && !XNextEvent(dpy, &ev))
|
||||
while(running && !XNextEvent(dpy, &ev)) {
|
||||
if(handler[ev.type])
|
||||
handler[ev.type](&ev); /* call handler */
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
scan(void) {
|
||||
@ -1426,7 +1470,7 @@ void
|
||||
sendmon(Client *c, Monitor *m) {
|
||||
if(c->mon == m)
|
||||
return;
|
||||
unfocus(c);
|
||||
unfocus(c, True);
|
||||
detach(c);
|
||||
detachstack(c);
|
||||
c->mon = m;
|
||||
@ -1449,10 +1493,9 @@ void
|
||||
setlayout(const Arg *arg) {
|
||||
if(!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
|
||||
selmon->sellt ^= 1;
|
||||
if(arg && arg->v) {
|
||||
if(arg && arg->v)
|
||||
selmon->lt[selmon->sellt] = (Layout *)arg->v;
|
||||
strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol);
|
||||
}
|
||||
if(selmon->sel)
|
||||
arrange(selmon);
|
||||
else
|
||||
@ -1494,6 +1537,8 @@ setup(void) {
|
||||
wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False);
|
||||
netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
|
||||
netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
|
||||
netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False);
|
||||
netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False);
|
||||
/* init cursors */
|
||||
cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr);
|
||||
cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing);
|
||||
@ -1662,11 +1707,12 @@ toggleview(const Arg *arg) {
|
||||
}
|
||||
|
||||
void
|
||||
unfocus(Client *c) {
|
||||
unfocus(Client *c, Bool setfocus) {
|
||||
if(!c)
|
||||
return;
|
||||
grabbuttons(c, False);
|
||||
XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]);
|
||||
if(setfocus)
|
||||
XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
|
||||
}
|
||||
|
||||
@ -2002,7 +2048,7 @@ zoom(const Arg *arg) {
|
||||
int
|
||||
main(int argc, char *argv[]) {
|
||||
if(argc == 2 && !strcmp("-v", argv[1]))
|
||||
die("dwm-"VERSION", © 2006-2009 dwm engineers, see LICENSE for details\n");
|
||||
die("dwm-"VERSION", © 2006-2010 dwm engineers, see LICENSE for details\n");
|
||||
else if(argc != 1)
|
||||
die("usage: dwm [-v]\n");
|
||||
if(!setlocale(LC_CTYPE, "") || !XSupportsLocale())
|
||||
|
Reference in New Issue
Block a user