Xinqi Bao's Git
projects
/
dwm.git
/ diff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
|
inline
| side by side (parent:
c53b29e
)
more debug output, experimental focus optimisation
author
Anselm R Garbe <
[email protected]
>
Wed, 31 Mar 2010 23:14:15 +0000
(
00:14
+0100)
committer
Anselm R Garbe <
[email protected]
>
Wed, 31 Mar 2010 23:14:15 +0000
(
00:14
+0100)
dwm.c
diff
|
blob
|
history
diff --git
a/dwm.c
b/dwm.c
index
b989e8a
..
b1f77cc
100644
(file)
--- a/
dwm.c
+++ b/
dwm.c
@@
-815,8
+815,12
@@
void
focus(Client *c) {
if(!c || !ISVISIBLE(c))
for(c = selmon->stack; c && !ISVISIBLE(c); c = c->snext);
focus(Client *c) {
if(!c || !ISVISIBLE(c))
for(c = selmon->stack; c && !ISVISIBLE(c); c = c->snext);
-/* if(selmon->sel)
- unfocus(selmon->sel);*/
+ if(c && c == selmon->sel) {
+ D fprintf(stderr, "focus, optimising focus away\n");
+ return;
+ }
+ if(selmon->sel)
+ unfocus(selmon->sel);
if(c) {
if(c->mon != selmon)
selmon = c->mon;
if(c) {
if(c->mon != selmon)
selmon = c->mon;
@@
-848,7
+852,8
@@
focusmon(const Arg *arg) {
if(!mons->next)
return;
if(!mons->next)
return;
- m = dirtomon(arg->i);
+ if((m = dirtomon(arg->i)) == selmon)
+ return;
unfocus(selmon->sel);
selmon = m;
focus(NULL);
unfocus(selmon->sel);
selmon = m;
focus(NULL);
@@
-1406,7
+1411,7
@@
run(void) {
/* main event loop */
XSync(dpy, False);
while(running && !XNextEvent(dpy, &ev)) {
/* main event loop */
XSync(dpy, False);
while(running && !XNextEvent(dpy, &ev)) {
- D fprintf(stderr, "run event %s
\n", evname[ev.type]
);
+ D fprintf(stderr, "run event %s
%ld\n", evname[ev.type], ev.xany.window
);
if(handler[ev.type])
handler[ev.type](&ev); /* call handler */
}
if(handler[ev.type])
handler[ev.type](&ev); /* call handler */
}