diff --git a/st.c b/st.c index 4d543d1..60c5658 100644 --- a/st.c +++ b/st.c @@ -410,6 +410,7 @@ static void xunloadfont(Font *f); static void xunloadfonts(void); static void xresize(int, int); +static void ffw(XEvent *); static void expose(XEvent *); static void visibility(XEvent *); static void unmap(XEvent *); @@ -1136,6 +1137,7 @@ brelease(XEvent *e) { void bmotion(XEvent *e) { int oldey, oldex, oldsby, oldsey; + ffw(e); if(IS_SET(MODE_MOUSE)) { mousereport(e); @@ -3456,6 +3458,11 @@ drawregion(int x1, int y1, int x2, int y2) { } void +ffw(XEvent *ev) { + while (XCheckTypedEvent(xw.dpy, ev->type, ev)) ; +} + +void expose(XEvent *ev) { XExposeEvent *e = &ev->xexpose; @@ -3468,6 +3475,7 @@ expose(XEvent *ev) { void visibility(XEvent *ev) { + ffw(ev); XVisibilityEvent *e = &ev->xvisibility; if(e->state == VisibilityFullyObscured) { @@ -3500,6 +3508,7 @@ xseturgency(int add) { void focus(XEvent *ev) { + ffw(ev); XFocusChangeEvent *e = &ev->xfocus; if(e->mode == NotifyGrab) @@ -3654,6 +3663,7 @@ cresize(int width, int height) { void resize(XEvent *e) { + ffw(e); if(e->xconfigure.width == xw.w && e->xconfigure.height == xw.h) return;