/** Discard key events for the specified window. */ void DiscardKeyEvents(XEvent *event, Window w) { JXSync(display, False); while(JXCheckTypedWindowEvent(display, w, KeyPress, event)) { UpdateTime(event); } }
/** Handle an unmap notify event. */ void HandleUnmapNotify(const XUnmapEvent *event) { ClientNode *np; XEvent e; Assert(event); np = FindClientByWindow(event->window); if(np && np->window == event->window) { if(JXCheckTypedWindowEvent(display, np->window, DestroyNotify, &e)) { HandleDestroyNotify(&e.xdestroywindow); return; } if(np->controller) { (np->controller)(1); } if(np->state.status & STAT_MAPPED) { np->state.status &= ~STAT_MAPPED; JXUnmapWindow(display, np->parent); WriteState(np); UpdateTaskBar(); UpdatePager(); } } }
/** Handle an unmap notify event. */ void HandleUnmapNotify(const XUnmapEvent *event) { ClientNode *np; XEvent e; Assert(event); if(event->window != event->event) { /* Allow ICCCM synthetic UnmapNotify events through. */ if (event->event != rootWindow || !event->send_event) { return; } } np = FindClientByWindow(event->window); if(np) { /* Grab the server to prevent the client from destroying the * window after we check for a DestroyNotify. */ GrabServer(); if(np->controller) { (np->controller)(1); } if(JXCheckTypedWindowEvent(display, np->window, DestroyNotify, &e)) { UpdateTime(&e); RemoveClient(np); } else if((np->state.status & STAT_MAPPED) || event->send_event) { if(!(np->state.status & STAT_HIDDEN)) { np->state.status &= ~STAT_MAPPED; JXUngrabButton(display, AnyButton, AnyModifier, np->window); GravitateClient(np, 1); JXReparentWindow(display, np->window, rootWindow, np->x, np->y); WriteState(np); JXRemoveFromSaveSet(display, np->window); RemoveClient(np); } } UngrabServer(); } }