/** Shutdown the dock. */ void ShutdownDock(void) { DockNode *np; if(dock) { /* Release memory used by the dock list. */ while(dock->nodes) { np = dock->nodes->next; JXReparentWindow(display, dock->nodes->window, rootWindow, 0, 0); Release(dock->nodes); dock->nodes = np; } /* Release the selection. */ if(owner) { JXSetSelectionOwner(display, dockAtom, None, CurrentTime); } /* Destroy the dock window. */ JXDestroyWindow(display, dock->window); } }
/** Signal popup (this is used to hide popups after awhile). */ void SignalPopup(const TimeType *now, int x, int y, Window w, void *data) { if(popup.window != None) { if(popup.mw != w || abs(popup.mx - x) > 0 || abs(popup.my - y) > 0) { JXDestroyWindow(display, popup.window); JXFreePixmap(display, popup.pmap); popup.window = None; } } }
/** Shutdown popups. */ void ShutdownPopup(void) { UnregisterCallback(SignalPopup, NULL); if(popup.text) { Release(popup.text); popup.text = NULL; } if(popup.window != None) { JXDestroyWindow(display, popup.window); JXFreePixmap(display, popup.pmap); popup.window = None; } }
/** Process an event on a popup window. */ char ProcessPopupEvent(const XEvent *event) { if(popup.window != None && event->xany.window == popup.window) { if(event->type == Expose && event->xexpose.count == 0) { JXCopyArea(display, popup.pmap, popup.window, rootGC, 0, 0, popup.width, popup.height, 0, 0); } else if(event->type == MotionNotify) { JXDestroyWindow(display, popup.window); JXFreePixmap(display, popup.pmap); popup.window = None; } return 1; } return 0; }
/** Shutdown trays. */ void ShutdownTray(void) { TrayType *tp; TrayComponentType *cp; for(tp = trays; tp; tp = tp->next) { for(cp = tp->components; cp; cp = cp->next) { if(cp->Destroy) { (cp->Destroy)(cp); } } JXDestroyWindow(display, tp->window); } }
/** Shutdown background support. */ void ShutdownBackgrounds() { BackgroundNode *bp; for(bp = backgrounds; bp; bp = bp->next) { if(bp->pixmap != None) { JXFreePixmap(display, bp->pixmap); bp->pixmap = None; } if(bp->window != None) { JXDestroyWindow(display, bp->window); bp->window = None; } } }
/** Shutdown trays. */ void ShutdownTray() { TrayType *tp; TrayComponentType *cp; for(tp = trays; tp; tp = tp->next) { for(cp = tp->components; cp; cp = cp->next) { if(cp->Destroy) { (cp->Destroy)(cp); } } JXDestroyWindow(display, tp->window); } if(supportingWindow != None) { XDestroyWindow(display, supportingWindow); supportingWindow = None; } }
/** Remove a client window from management. */ void RemoveClient(ClientNode *np) { ColormapNode *cp; Assert(np); Assert(np->window != None); /* Remove this client from the client list */ if(np->next) { np->next->prev = np->prev; } else { nodeTail[np->state.layer] = np->prev; } if(np->prev) { np->prev->next = np->next; } else { nodes[np->state.layer] = np->next; } clientCount -= 1; XDeleteContext(display, np->window, clientContext); if(np->parent != None) { XDeleteContext(display, np->parent, frameContext); } if(np->state.status & STAT_URGENT) { UnregisterCallback(SignalUrgent, np); } /* Make sure this client isn't active */ if(activeClient == np && !shouldExit) { FocusNextStacked(np); } if(activeClient == np) { /* Must be the last client. */ SetWindowAtom(rootWindow, ATOM_NET_ACTIVE_WINDOW, None); activeClient = NULL; JXSetInputFocus(display, rootWindow, RevertToParent, eventTime); } /* If the window manager is exiting (ie, not the client), then * reparent etc. */ if(shouldExit && !(np->state.status & STAT_WMDIALOG)) { if(np->state.maxFlags) { np->x = np->oldx; np->y = np->oldy; np->width = np->oldWidth; np->height = np->oldHeight; JXMoveResizeWindow(display, np->window, np->x, np->y, np->width, np->height); } GravitateClient(np, 1); if(!(np->state.status & STAT_MAPPED) && (np->state.status & (STAT_MINIMIZED | STAT_SHADED))) { JXMapWindow(display, np->window); } JXUngrabButton(display, AnyButton, AnyModifier, np->window); JXReparentWindow(display, np->window, rootWindow, np->x, np->y); JXRemoveFromSaveSet(display, np->window); } /* Destroy the parent */ if(np->parent) { JXDestroyWindow(display, np->parent); } if(np->name) { Release(np->name); } if(np->instanceName) { JXFree(np->instanceName); } if(np->className) { JXFree(np->className); } RemoveClientFromTaskBar(np); RemoveClientStrut(np); while(np->colormaps) { cp = np->colormaps->next; Release(np->colormaps); np->colormaps = cp; } DestroyIcon(np->icon); Release(np); RequireRestack(); }