XSync(ob_display, FALSE);
if (focus_client == self) {
- XEvent e;
-
- /* focus the last focused window on the desktop, and ignore enter
- events from the unmap so it doesnt mess with the focus */
- while (XCheckTypedEvent(ob_display, EnterNotify, &e));
+ /* ignore enter events from the unmap so it doesnt mess with the focus
+ */
+ event_ignore_queued_enters();
}
void popup_hide(ObPopup *self)
{
if (self->mapped) {
- XEvent e;
-
XUnmapWindow(ob_display, self->bg);
self->mapped = FALSE;
/* kill enter events cause by this unmapping */
- XSync(ob_display, FALSE);
- while (XCheckTypedEvent(ob_display, EnterNotify, &e));
+ event_ignore_queued_enters();
}
}