From 9c73646d9c709005301d5be93d0232d89201b21e Mon Sep 17 00:00:00 2001 From: Arthur Williams Date: Wed, 15 Sep 2021 01:33:51 -0700 Subject: Exit when window is destroyed If the user closed our window, the program won't automatically be die. It may look dead as there would be no graphical indication that it was running, but it still would be using/wasting the same resources. Now the program will abruptly exit when its window is killed. --- main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.c b/main.c index 21d69bc..61f728f 100644 --- a/main.c +++ b/main.c @@ -767,6 +767,9 @@ void run(void) if ((Atom) ev.xclient.data.l[0] == atoms[ATOM_WM_DELETE_WINDOW]) cmds[g_quit].func(0); break; + case DestroyNotify: + exit(EXIT_FAILURE); + break; case ConfigureNotify: if (win_configure(&win, &ev.xconfigure)) { if (mode == MODE_IMAGE) { -- cgit v1.2.3