changeset: 1565:ee4aa582320a
branch: draw.c
tag: tip
parent: 1546:8993d1180a5c
parent: 1564:4548c824adac
user: Connor Lane Smith <cls_AT_lubutu.com>
date: Wed Jul 20 13:48:44 2011 +0100
files: dwm.c
description:
merge default -> draw.c
diff -r 8993d1180a5c -r ee4aa582320a .hgtags
--- a/.hgtags Sat Jun 04 11:03:12 2011 +0100
+++ b/.hgtags Wed Jul 20 13:48:44 2011 +0100
@@ -69,3 +69,4 @@
60ea8fed13ab750c6717f2764cbf9c13bb6f0d0a 5.8
1ed1e75c9c2e395a2c475b52657a430bd95070c7 5.8.1
a043f08008051ca02ae87eb170cd066d8c8315a0 5.8.2
+dd74622a4785e55658b05b36834fa0c41084a8c1 5.9
diff -r 8993d1180a5c -r ee4aa582320a BUGS
--- a/BUGS Sat Jun 04 11:03:12 2011 +0100
+++ b/BUGS Wed Jul 20 13:48:44 2011 +0100
@@ -8,27 +8,6 @@
---
-> 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;
-
---- - -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 diff -r 8993d1180a5c -r ee4aa582320a LICENSE --- a/LICENSE Sat Jun 04 11:03:12 2011 +0100 +++ b/LICENSE Wed Jul 20 13:48:44 2011 +0100 @@ -1,6 +1,6 @@ MIT/X Consortium License -© 2006-2010 Anselm R Garbe <anselm_AT_garbe.us> +© 2006-2011 Anselm R Garbe <anselm_AT_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> @@ -10,7 +10,7 @@ © 2007-2008 Peter Hartlich <sgkkr at hartlich dot com> © 2008 Martin Hurton <martin dot hurton at gmail dot com> © 2008 Neale Pickett <neale dot woozle dot org> -© 2009 Mate Nagy <mnagy_AT_port70.net> +© 2009 Mate Nagy <mnagy at port70 dot net> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), diff -r 8993d1180a5c -r ee4aa582320a config.mk --- a/config.mk Sat Jun 04 11:03:12 2011 +0100 +++ b/config.mk Wed Jul 20 13:48:44 2011 +0100 @@ -20,10 +20,10 @@ # 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}\" diff -r 8993d1180a5c -r ee4aa582320a dwm.c --- a/dwm.c Sat Jun 04 11:03:12 2011 +0100 +++ b/dwm.c Wed Jul 20 13:48:44 2011 +0100 @@ -43,7 +43,7 @@ /* macros */ #define BUTTONMASK (ButtonPressMask|ButtonReleaseMask) -#define CLEANMASK(mask) ((mask) & ~(numlockmask|LockMask)) +#define CLEANMASK(mask) ((mask) & ~(numlockmask|LockMask) & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)) #define INRECT(X,Y,RX,RY,RW,RH) ((X) >= (RX) && (X) < (RX) + (RW) && (Y) >= (RY) && (Y) < (RY) + (RH)) #define ISVISIBLE(C) (((C)->tags & (C)->mon->tagset[(C)->mon->seltags])) #define LENGTH(X) (sizeof (X) / sizeof *(X)) @@ -422,7 +422,7 @@ } else if(ev->x < x + blw) click = ClkLtSymbol; - else if(ev->x > selmon->wx + selmon->ww - textw(dc, stext)) + else if(ev->x > selmon->ww - textw(dc, stext)) click = ClkStatusText; else click = ClkWinTitle; @@ -504,7 +504,7 @@ if(!c) return; if(cme->message_type == netatom[NetWMState] && cme->data.l[1] == netatom[NetWMFullscreen]) { - if(cme->data.l[0]) { + if(cme->data.l[0] && !c->isfullscreen) { XChangeProperty(dpy, cme->window, netatom[NetWMState], XA_ATOM, 32, PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1); c->isfullscreen = True; @@ -560,11 +560,13 @@ configurenotify(XEvent *e) { Monitor *m; XConfigureEvent *ev = &e->xconfigure; + Bool dirty; if(ev->window == root) { + dirty = (sw != ev->width); sw = ev->width; sh = ev->height; - if(updategeom()) { + if(updategeom() || dirty) { resizedc(dc, sw, bh); updatebars(); for(m = mons; m; m = m->next) @@ -746,16 +748,21 @@ void enternotify(XEvent *e) { + Client *c; Monitor *m; XCrossingEvent *ev = &e->xcrossing; if((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root) return; - if((m = wintomon(ev->window)) && m != selmon) { + c = wintoclient(ev->window); + m = c ? c->mon : wintomon(ev->window); + if(m != selmon) { unfocus(selmon->sel, True); selmon = m; } - focus((wintoclient(ev->window))); + else if(!c || c == selmon->sel) + return; + focus(c); } void @@ -989,8 +996,8 @@ applyrules(c); } /* geometry */ - c->x = c->oldx = wa->x + c->mon->wx; - c->y = c->oldy = wa->y + c->mon->wy; + c->x = c->oldx = wa->x; + c->y = c->oldy = wa->y; c->w = c->oldw = wa->width; c->h = c->oldh = wa->height; c->oldbw = wa->border_width; @@ -1283,6 +1290,7 @@ run(void) { XEvent ev; /* main event loop */ + XSync(dpy, False); while(running && !XNextEvent(dpy, &ev)) { if(handler[ev.type]) handler[ev.type](&ev); /* call handler */ @@ -1902,7 +1910,6 @@ Client *c = selmon->sel; if(!selmon->lt[selmon->sellt]->arrange - || selmon->lt[selmon->sellt]->arrange == monocle || (selmon->sel && selmon->sel->isfloating)) return; if(c == nexttiled(selmon->clients)) @@ -1914,7 +1921,7 @@ int main(int argc, char *argv[]) { if(argc == 2 && !strcmp("-v", argv[1])) { - fputs("dwm-"VERSION", © 2006-2011 dwm engineers, see LICENSE for details\n", stdout); + puts("dwm-"VERSION", © 2006-2011 dwm engineers, see LICENSE for details"); exit(EXIT_SUCCESS); } else if(argc != 1)Received on Wed Jul 20 2011 - 14:52:29 CEST
This archive was generated by hypermail 2.2.0 : Wed Jul 20 2011 - 15:00:07 CEST