MCPcopy Create free account
hub / github.com/SimHacker/micropolis / MasterStructureProc

Function MasterStructureProc

micropolis-activity/src/tk/tkplace.c:834–864  ·  view source on GitHub ↗
(clientData, eventPtr)

Source from the content-addressed store, hash-verified

832 * None.
833 *
834 * Side effects:
835 * Structures get cleaned up if the window was deleted. If the
836 * window was resized then slave geometries get recomputed.
837 *
838 *----------------------------------------------------------------------
839 */
840
841static void
842MasterStructureProc(clientData, eventPtr)
843 ClientData clientData; /* Pointer to Master structure for window
844 * referred to by eventPtr. */
845 XEvent *eventPtr; /* Describes what just happened. */
846{
847 register Master *masterPtr = (Master *) clientData;
848 register Slave *slavePtr, *nextPtr;
849
850 if (eventPtr->type == ConfigureNotify) {
851 if ((masterPtr->slavePtr != NULL)
852 && !(masterPtr->flags & PARENT_RECONFIG_PENDING)) {
853 masterPtr->flags |= PARENT_RECONFIG_PENDING;
854 Tk_DoWhenIdle(RecomputePlacement, (ClientData) masterPtr);
855 }
856 } else if (eventPtr->type == DestroyNotify) {
857 for (slavePtr = masterPtr->slavePtr; slavePtr != NULL;
858 slavePtr = nextPtr) {
859 slavePtr->masterPtr = NULL;
860 nextPtr = slavePtr->nextPtr;
861 slavePtr->nextPtr = NULL;
862 }
863 Tcl_DeleteHashEntry(Tcl_FindHashEntry(&masterTable,
864 (char *) masterPtr->tkwin));
865 if (masterPtr->flags & PARENT_RECONFIG_PENDING) {
866 Tk_CancelIdleCall(RecomputePlacement, (ClientData) masterPtr);
867 }

Callers

nothing calls this directly

Calls 3

Tcl_DeleteHashEntryFunction · 0.85
Tk_DoWhenIdleFunction · 0.70
Tk_CancelIdleCallFunction · 0.70

Tested by

no test coverage detected