dwm

Kris's build of dwm
git clone git clone https://git.krisyotam.com/krisyotam/dwm.git
Log | Files | Refs | README | LICENSE

games.c (741B)


      1 void
      2 minimize(Client *c)
      3 {
      4 	if (!c || HIDDEN(c))
      5 		return;
      6 
      7 	Window w = c->win;
      8 	static XWindowAttributes ra, ca;
      9 
     10 	/* More or less taken directly from blackbox's hide() function */
     11 	XGrabServer(dpy);
     12 	XGetWindowAttributes(dpy, root, &ra);
     13 	XGetWindowAttributes(dpy, w, &ca);
     14 	/* Prevent UnmapNotify events */
     15 	XSelectInput(dpy, root, ra.your_event_mask & ~SubstructureNotifyMask);
     16 	XSelectInput(dpy, w, ca.your_event_mask & ~StructureNotifyMask);
     17 	XUnmapWindow(dpy, w);
     18 	setclientstate(c, IconicState);
     19 	XSelectInput(dpy, root, ra.your_event_mask);
     20 	XSelectInput(dpy, w, ca.your_event_mask);
     21 	XUngrabServer(dpy);
     22 }
     23 
     24 void
     25 unminimize(Client *c)
     26 {
     27 	if (!c || !HIDDEN(c))
     28 		return;
     29 
     30 	XMapWindow(dpy, c->win);
     31 	setclientstate(c, NormalState);
     32 }