xiwm

simple window manager
git clone https://git.ce9e.org/xiwm.git

commit
aa67219b86e71a4745d3e6de5f865941d95680cd
parent
4c62dab51a214abc50a4407e8885d9c3712526b5
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2019-10-13 08:46
refactor manage()

Diffstat

M xiwm.c 27 ++++++++++-----------------

1 files changed, 10 insertions, 17 deletions


diff --git a/xiwm.c b/xiwm.c

@@ -447,7 +447,6 @@ applyrules(Client *c)
  447   447 		XFree(ch.res_class);
  448   448 	if (ch.res_name)
  449   449 		XFree(ch.res_name);
  450    -1 	xsetclientdesktop(c);
  451   450 }
  452   451 
  453   452 void
@@ -498,29 +497,28 @@ manage(Window w, XWindowAttributes *wa)
  498   497 	c = calloc(1, sizeof(Client));
  499   498 	c->win = w;
  500   499 	c->position = PMax;
   -1   500 	c->desktop = desktop;
  501   501 	/* geometry */
  502   502 	c->fx = c->x = wa->x == 0 ? (sw - wa->width) / 2 : wa->x;
  503   503 	c->fy = c->y = wa->y == 0 ? (sh - wa->height) / 2 : wa->y;
  504   504 	c->fw = c->w = wa->width;
  505   505 	c->fh = c->h = wa->height;
  506   506 
  507    -1 	if (XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) {
   -1   507 	applyrules(c);
   -1   508 	if (XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans)))
  508   509 		c->desktop = t->desktop;
  509    -1 		xsetclientdesktop(c);
  510    -1 	} else {
  511    -1 		c->desktop = desktop;
  512    -1 		applyrules(c);
  513    -1 	}
   -1   510 	xsetclientdesktop(c);
  514   511 	updatewindowtype(c);
   -1   512 	updatefixed(c);
   -1   513 	if (trans != None || c->isfixed)
   -1   514 		c->position = PFloat;
   -1   515 
   -1   516 	if (c->isdock)
   -1   517 		bh = c->h;
  515   518 
  516   519 	XSetWindowBorder(dpy, c->win, col_norm);
  517    -1 	updatefixed(c);
  518   520 	XSelectInput(dpy, w, WINMASK);
  519   521 	grabbuttons(c, False);
  520    -1 	if (trans != None || c->isfixed)
  521    -1 		c->position = PFloat;
  522    -1 	if (c->position == PFloat)
  523    -1 		XRaiseWindow(dpy, c->win);
  524   522 	attach(c);
  525   523 	XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32,
  526   524 		PropModeAppend, (unsigned char *) &(c->win), 1);
@@ -529,11 +527,6 @@ manage(Window w, XWindowAttributes *wa)
  529   527 	XMapWindow(dpy, c->win);
  530   528 	focus(NULL);
  531   529 	layout();
  532    -1 
  533    -1 	if (c->isdock) {
  534    -1 		bh = c->h;
  535    -1 		layout();
  536    -1 	}
  537   530 }
  538   531 
  539   532 void