Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
spectrwm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
52952ea
)
Add event_drain() and drain EnterNotify where appropriate.
author
Reginald Kennedy
<rk@rejii.com>
Sun, 15 Jul 2012 15:24:52 +0000
(23:24 +0800)
committer
Reginald Kennedy
<rk@rejii.com>
Fri, 20 Jul 2012 21:59:30 +0000
(
05:59
+0800)
spectrwm.c
patch
|
blob
|
history
diff --git
a/spectrwm.c
b/spectrwm.c
index
f75a35e
..
f2c67fa
100644
(file)
--- a/
spectrwm.c
+++ b/
spectrwm.c
@@
-2515,6
+2515,20
@@
focus_win(struct ws_win *win)
}
void
}
void
+event_drain(uint8_t rt)
+{
+ xcb_generic_event_t *evt;
+
+ xcb_flush(conn);
+ while ((evt = xcb_poll_for_event(conn))) {
+ if (XCB_EVENT_RESPONSE_TYPE(evt) != rt)
+ event_handle(evt);
+
+ free(evt);
+ }
+}
+
+void
switchws(struct swm_region *r, union arg *args)
{
int wsid = args->id, unmap_old = 0;
switchws(struct swm_region *r, union arg *args)
{
int wsid = args->id, unmap_old = 0;
@@
-2568,7
+2582,10
@@
switchws(struct swm_region *r, union arg *args)
TAILQ_FOREACH(win, &old_ws->winlist, entry)
unmap_window(win);
TAILQ_FOREACH(win, &old_ws->winlist, entry)
unmap_window(win);
- xcb_flush(conn);
+ if (focus_mode == SWM_FOCUS_DEFAULT)
+ event_drain(XCB_ENTER_NOTIFY);
+ else
+ xcb_flush(conn);
}
void
}
void
@@
-2981,8
+2998,10
@@
cycle_layout(struct swm_region *r, union arg *args)
stack();
stack();
- a.id = SWM_ARG_ID_FOCUSCUR;
+ if (focus_mode == SWM_FOCUS_DEFAULT)
+ event_drain(XCB_ENTER_NOTIFY);
+ a.id = SWM_ARG_ID_FOCUSCUR;
focus(r, &a);
}
focus(r, &a);
}
@@
-4112,6
+4131,7
@@
floating_toggle(struct swm_region *r, union arg *args)
}
xcb_flush(conn);
}
xcb_flush(conn);
+ event_drain(XCB_ENTER_NOTIFY);
}
void
}
void