Krolyxon
Commit 9c73646

Branches

Refs →

nsxiv9c73646

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.
Author
Arthur Williams
Date
2021-09-15 01:33 -0700
Committer
Berke Kocaoğlu · 2021-09-16 22:55 +0300
Parent
25a3114
Commit
9c73646d9c709005301d5be93d0232d89201b21e

+3 −0

1 file changed

  1. M main.c +3 −0
M main.c View
@@ -767,6 +767,9 @@ void run(void)
767767 if ((Atom) ev.xclient.data.l[0] == atoms[ATOM_WM_DELETE_WINDOW])
768768 cmds[g_quit].func(0);
769769 break;
770+ case DestroyNotify:
771+ exit(EXIT_FAILURE);
772+ break;
770773 case ConfigureNotify:
771774 if (win_configure(&win, &ev.xconfigure)) {
772775 if (mode == MODE_IMAGE) {