[Scummvm-git-logs] scummvm master -> fef094d8394a2659a6fc4a4ad85610f93938f8b6

sev- noreply at scummvm.org
Wed Jul 15 21:11:26 UTC 2026


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
fef094d839 SDL: Preserve events outside ImGui input capture


Commit: fef094d8394a2659a6fc4a4ad85610f93938f8b6
    https://github.com/scummvm/scummvm/commit/fef094d8394a2659a6fc4a4ad85610f93938f8b6
Author: AndywinXp (andywinxp at gmail.com)
Date: 2026-07-15T23:11:22+02:00

Commit Message:
SDL: Preserve events outside ImGui input capture

Changed paths:
    backends/events/sdl/sdl2-events.cpp
    backends/events/sdl/sdl3-events.cpp


diff --git a/backends/events/sdl/sdl2-events.cpp b/backends/events/sdl/sdl2-events.cpp
index 338c1419f77..8b23ee39112 100644
--- a/backends/events/sdl/sdl2-events.cpp
+++ b/backends/events/sdl/sdl2-events.cpp
@@ -695,7 +695,10 @@ bool SdlEventSource::pollEvent(Common::Event &event) {
 		if (ImGui_ImplSDL2_Ready()) {
 			ImGui_ImplSDL2_ProcessEvent(&ev);
 			ImGuiIO &io = ImGui::GetIO();
-			if (io.WantTextInput || io.WantCaptureMouse)
+			bool mouseEvent = ev.type == SDL_MOUSEMOTION || ev.type == SDL_MOUSEBUTTONDOWN ||
+				ev.type == SDL_MOUSEBUTTONUP || ev.type == SDL_MOUSEWHEEL;
+			bool textEvent = ev.type == SDL_TEXTINPUT;
+			if ((mouseEvent && io.WantCaptureMouse) || (textEvent && io.WantTextInput))
 				continue;
 		}
 #endif
@@ -779,7 +782,16 @@ bool SdlEventSource::dispatchSDLEvent(SDL_Event &ev, Common::Event &event) {
 			}
 		}
 
-		switch (ev.window.event) {
+	switch (ev.window.event) {
+	case SDL_WINDOWEVENT_CLOSE:
+		if (_graphicsManager) {
+			uint32 windowID = SDL_GetWindowID(_graphicsManager->getWindow()->getSDLWindow());
+			if (windowID != ev.window.windowID)
+				return false;
+		}
+
+		event.type = Common::EVENT_QUIT;
+		return true;
 
 		case SDL_WINDOWEVENT_EXPOSED:
 			if (_graphicsManager) {
diff --git a/backends/events/sdl/sdl3-events.cpp b/backends/events/sdl/sdl3-events.cpp
index c2d061904d9..2060d41fbb3 100644
--- a/backends/events/sdl/sdl3-events.cpp
+++ b/backends/events/sdl/sdl3-events.cpp
@@ -678,7 +678,10 @@ bool SdlEventSource::pollEvent(Common::Event &event) {
 #if defined(USE_IMGUI)
 		ImGui_ImplSDL3_ProcessEvent(&ev);
 		ImGuiIO &io = ImGui::GetIO();
-		if (io.WantTextInput || io.WantCaptureMouse)
+		bool mouseEvent = ev.type == SDL_EVENT_MOUSE_MOTION || ev.type == SDL_EVENT_MOUSE_BUTTON_DOWN ||
+			ev.type == SDL_EVENT_MOUSE_BUTTON_UP || ev.type == SDL_EVENT_MOUSE_WHEEL;
+		bool textEvent = ev.type == SDL_EVENT_TEXT_INPUT;
+		if ((mouseEvent && io.WantCaptureMouse) || (textEvent && io.WantTextInput))
 			continue;
 #endif
 		if (dispatchSDLEvent(ev, event))
@@ -748,6 +751,16 @@ bool SdlEventSource::dispatchSDLEvent(SDL_Event &ev, Common::Event &event) {
 		return _queuedFakeKeyUp;
 		}
 
+	case SDL_EVENT_WINDOW_CLOSE_REQUESTED:
+		if (_graphicsManager) {
+			uint32 windowID = SDL_GetWindowID(_graphicsManager->getWindow()->getSDLWindow());
+			if (windowID != ev.window.windowID)
+				return false;
+		}
+
+		event.type = Common::EVENT_QUIT;
+		return true;
+
 		case SDL_EVENT_WINDOW_EXPOSED:
 			if (_graphicsManager) {
 				_graphicsManager->notifyVideoExpose();




More information about the Scummvm-git-logs mailing list