xiwm

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

commit
ce0670e8b45a35058ccb52c42a500a102365f1f3
parent
8ef7bbb997fd535ec669cd815d2a0a8de5746ebe
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2019-10-13 07:58
simplify unmanage

Diffstat

M xiwm.c 17 +++--------------

1 files changed, 3 insertions, 14 deletions


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

@@ -552,22 +552,11 @@ manage(Window w, XWindowAttributes *wa)
  552   552 }
  553   553 
  554   554 void
  555    -1 unmanage(Client *c, Bool destroyed)
   -1   555 unmanage(Client *c)
  556   556 {
  557   557 	Client *i;
  558    -1 	XWindowChanges wc;
  559   558 
  560   559 	detach(c);
  561    -1 	if (!destroyed) {
  562    -1 		XGrabServer(dpy); /* avoid race conditions */
  563    -1 		XSetErrorHandler(xerrordummy);
  564    -1 		XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore border */
  565    -1 		XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
  566    -1 		xsetclientstate(c, WithdrawnState);
  567    -1 		XSync(dpy, False);
  568    -1 		XSetErrorHandler(xerror);
  569    -1 		XUngrabServer(dpy);
  570    -1 	}
  571   560 	free(c);
  572   561 	focus(NULL);
  573   562 	XDeleteProperty(dpy, root, netatom[NetClientList]);
@@ -648,7 +637,7 @@ unmapnotify(XEvent *e)
  648   637 		if (ev->send_event)
  649   638 			xsetclientstate(c, WithdrawnState);
  650   639 		else
  651    -1 			unmanage(c, False);
   -1   640 			unmanage(c);
  652   641 	}
  653   642 }
  654   643 
@@ -971,7 +960,7 @@ void
  971   960 cleanup(void)
  972   961 {
  973   962 	while (clients)
  974    -1 		unmanage(clients, False);
   -1   963 		unmanage(clients);
  975   964 	XUngrabKey(dpy, AnyKey, AnyModifier, root);
  976   965 	XDestroyWindow(dpy, wmcheckwin);
  977   966 	XSync(dpy, False);