aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Williams <taaparthur@gmail.com>2021-09-15 01:33:51 -0700
committerBerke Kocaoğlu <berke.kocaoglu@metu.edu.tr>2021-09-16 22:55:31 +0300
commit9c73646d9c709005301d5be93d0232d89201b21e (patch)
tree4c9113b61f77e4ee3612152c29925f1f300ac266
parent25a31147093e249be997da9b42da6901496fdf52 (diff)
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.
-rw-r--r--main.c3
1 files changed, 3 insertions, 0 deletions
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) {