Beispiel #1
0
void send_wm_delete(Client *c, int kill_client) {
	int i, n, found = 0;
	Atom *protocols;

	if (!kill_client && XGetWMProtocols(dpy, c->window, &protocols, &n)) {
		for (i = 0; i < n; i++)
			if (protocols[i] == xa_wm_delete)
				found++;
		XFree(protocols);
	}
	if (found)
		send_xmessage(c->window, xa_wm_protos, xa_wm_delete);
	else
		XKillClient(dpy, c->window);
}
Beispiel #2
0
void send_wm_delete(Client *c)
{
	int n, found = 0;
	Atom *protocols;

	if (c) {
		if (XGetWMProtocols(dpy, c->window, &protocols, &n)) {
			for (int i = 0; i < n; i++)
				if (protocols[i] == xa_wm_delete) found++;

			XFree(protocols);
		}

		if (found)
			send_xmessage(c->window, xa_wm_protos, xa_wm_delete);
		else
			XKillClient(dpy, c->window);
	}

	next(NULL);
}