summaryrefslogtreecommitdiff
path: root/system/kegs/allow_window_close.diff
blob: b1343b2e89419957e4c33ce6c95dece02f550439 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
diff -Naur kegs.1.05/src/xdriver.c kegs.1.05.patched/src/xdriver.c
--- kegs.1.05/src/xdriver.c	2021-01-24 18:37:34.000000000 -0500
+++ kegs.1.05.patched/src/xdriver.c	2021-02-25 17:53:28.054595900 -0500
@@ -629,13 +629,10 @@
 		0, &my_winSizeHints, 0, &my_winClassHint);
 	XMapRaised(g_display, x_win);
 
-	if(win_info_ptr != &g_mainwin_info) {
-		// Debugger window
 		win_info_ptr->delete_atom = XInternAtom(g_display,
 						"WM_DELETE_WINDOW", False);
 		XSetWMProtocols(g_display, x_win, &(win_info_ptr->delete_atom),
 									1);
-	}
 
 	XSync(g_display, False);
 
@@ -1092,9 +1089,15 @@
 		case ClientMessage:
 			win_info_ptr = x_find_xwin(ev.xclient.window);
 			if(ev.xclient.data.l[0] == win_info_ptr->delete_atom) {
-				// This is a WM_DELETE_WINDOW event
-				// Just unmap the window
-				win_info_ptr->kimage_ptr->active = 0;
+				if(win_info_ptr == &g_debugwin_info) {
+					// This is a WM_DELETE_WINDOW event
+					// Just unmap the window
+					win_info_ptr->kimage_ptr->active = 0;
+				} else {
+					x_auto_repeat_on(1);
+					XCloseDisplay(g_display);
+					exit(0);
+				}
 			} else {
 				printf("unknown ClientMessage\n");
 			}