mirror of
https://github.com/vale981/spectrwm
synced 2025-03-05 18:01:37 -05:00
I have been debating this one for a while but I think we need to drain
all but the last event. So lets run with this for a while and see what happens.
This commit is contained in:
parent
f0c9f65a11
commit
69c9a026f3
1 changed files with 10 additions and 2 deletions
12
scrotwm.c
12
scrotwm.c
|
@ -941,6 +941,7 @@ set_win_state(struct ws_win *win, long state)
|
||||||
long data[] = {state, None};
|
long data[] = {state, None};
|
||||||
XEvent ev;
|
XEvent ev;
|
||||||
XWindowAttributes wa;
|
XWindowAttributes wa;
|
||||||
|
int putback;
|
||||||
|
|
||||||
DNPRINTF(SWM_D_EVENT, "set_win_state: window: %lu\n", win->id);
|
DNPRINTF(SWM_D_EVENT, "set_win_state: window: %lu\n", win->id);
|
||||||
|
|
||||||
|
@ -957,8 +958,11 @@ set_win_state(struct ws_win *win, long state)
|
||||||
(unsigned char *)data, 2);
|
(unsigned char *)data, 2);
|
||||||
|
|
||||||
/* wait for completion of XChangeProperty */
|
/* wait for completion of XChangeProperty */
|
||||||
|
putback = 0;
|
||||||
while (XCheckIfEvent(display, &ev, set_win_notify_cb, (char *)win))
|
while (XCheckIfEvent(display, &ev, set_win_notify_cb, (char *)win))
|
||||||
;
|
putback = 1;
|
||||||
|
if (putback)
|
||||||
|
XPutBackEvent(display, &ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
long
|
long
|
||||||
|
@ -1090,6 +1094,7 @@ unmap_window(struct ws_win *win)
|
||||||
{
|
{
|
||||||
XEvent ev;
|
XEvent ev;
|
||||||
XWindowAttributes wa;
|
XWindowAttributes wa;
|
||||||
|
int putback;
|
||||||
|
|
||||||
if (win == NULL)
|
if (win == NULL)
|
||||||
return;
|
return;
|
||||||
|
@ -1109,8 +1114,11 @@ unmap_window(struct ws_win *win)
|
||||||
XUnmapWindow(display, win->id);
|
XUnmapWindow(display, win->id);
|
||||||
|
|
||||||
/* make sure we wait for XUnmapWindow completion */
|
/* make sure we wait for XUnmapWindow completion */
|
||||||
|
putback = 0;
|
||||||
while (XCheckIfEvent(display, &ev, unmap_window_cb, (char *)win))
|
while (XCheckIfEvent(display, &ev, unmap_window_cb, (char *)win))
|
||||||
;
|
putback = 1;
|
||||||
|
if (putback)
|
||||||
|
XPutBackEvent(display, &ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Add table
Reference in a new issue