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.
+3 −0
1 file changed
- M main.c +3 −0
| @@ -767,6 +767,9 @@ void run(void) | |||
| 767 | 767 | if ((Atom) ev.xclient.data.l[0] == atoms[ATOM_WM_DELETE_WINDOW]) | |
| 768 | 768 | cmds[g_quit].func(0); | |
| 769 | 769 | break; | |
| 770 | + | case DestroyNotify: | |
| 771 | + | exit(EXIT_FAILURE); | |
| 772 | + | break; | |
| 770 | 773 | case ConfigureNotify: | |
| 771 | 774 | if (win_configure(&win, &ev.xconfigure)) { | |
| 772 | 775 | if (mode == MODE_IMAGE) { | |