shithub: qk1

Download patch

ref: e87abf9ce8f370d262cba430020d2c0a4c5b774e
parent: 8a7a14f7c62afe6b89e1c1da71252aa2585eb09b
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Wed Dec 13 13:26:31 EST 2023

unix/vid: menu_quit on window close event; use mouse focus instead of keyboard focus

--- a/unix/in.c
+++ b/unix/in.c
@@ -43,11 +43,14 @@
 			case SDL_WINDOWEVENT_RESIZED:
 				resized = 1;
 				break;
-			case SDL_WINDOWEVENT_FOCUS_LOST:
+			case SDL_WINDOWEVENT_CLOSE:
+				Cbuf_AddText("menu_quit\n");
+				break;
+			case SDL_WINDOWEVENT_LEAVE:
 				focuslost = mouseon;
 				IN_Grabm(0);
 				break;
-			case SDL_WINDOWEVENT_FOCUS_GAINED:
+			case SDL_WINDOWEVENT_ENTER:
 				IN_Grabm(focuslost);
 				break;
 			}