Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I keep track of changes to iconic/normal window state?

0
10 Posted

How can I keep track of changes to iconic/normal window state?

0
10

You can look at the WM_STATE property, but this breaks ICCCM guidelines. ICCCM compliant window managers will map windows in changing them to normal state and unmap them in changing them to iconic state. Look for StructureNotify events and check the event type: XtAddEventHandler (toplevel_widget, StructureNotifyMask, False, StateWatcher, (Opaque) NULL); void StateWatcher (w, unused, event) Widget w; caddr_t unused; XEvent *event; { if (event->type == MapNotify) printf (“normal\n”); else if (event->type == UnmapNotify) printf (“iconified\n”); else printf (“other event\n”); } If you insist on looking at WM_STATE, here is some code (from Ken Sall) to do it: /* —————————————————————— Try a function such as CheckWinMgrState below which returns one of IconicState | NormalState | WithdrawnState | NULL : —————————————————————— */ #define WM_STATE_ELEMENTS 1 unsigned long *CheckWinMgrState (dpy, window) Disp

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123