dwm

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

decorationhints.c (945B)


      1 static Atom motifatom;
      2 
      3 void
      4 updatemotifhints(Client *c)
      5 {
      6 	Atom real;
      7 	int format;
      8 	unsigned char *p = NULL;
      9 	unsigned long n, extra;
     10 	unsigned long *motif;
     11 	int width, height;
     12 
     13 	if (!decorhints)
     14 		return;
     15 
     16 	if (XGetWindowProperty(dpy, c->win, motifatom, 0L, 5L, False, motifatom,
     17 		                   &real, &format, &n, &extra, &p) == Success && p != NULL) {
     18 		motif = (unsigned long*)p;
     19 		if (motif[MWM_HINTS_FLAGS_FIELD] & MWM_HINTS_DECORATIONS) {
     20 			width = WIDTH(c);
     21 			height = HEIGHT(c);
     22 
     23 			if (motif[MWM_HINTS_DECORATIONS_FIELD] & MWM_DECOR_ALL ||
     24 				motif[MWM_HINTS_DECORATIONS_FIELD] & MWM_DECOR_BORDER ||
     25 				motif[MWM_HINTS_DECORATIONS_FIELD] & MWM_DECOR_TITLE)
     26 				#if SETBORDERPX_PATCH
     27 				c->bw = c->oldbw = c->mon->borderpx;
     28 				#else
     29 				c->bw = c->oldbw = borderpx;
     30 				#endif // SETBORDERPX_PATCH
     31 			else
     32 				c->bw = c->oldbw = 0;
     33 
     34 			resize(c, c->x, c->y, width - (2*c->bw), height - (2*c->bw), 0);
     35 		}
     36 		XFree(p);
     37 	}
     38 }
     39