[Scummvm-git-logs] scummvm master -> 6437ca1ede3550fbba7366d373e51654d1ab19d5

bgK bastien.bouclet at gmail.com
Tue Dec 26 21:29:59 CET 2017


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

Summary:
6437ca1ede PS3: Stop using SDL mouse focus events to detect the XMB


Commit: 6437ca1ede3550fbba7366d373e51654d1ab19d5
    https://github.com/scummvm/scummvm/commit/6437ca1ede3550fbba7366d373e51654d1ab19d5
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2017-12-26T21:29:30+01:00

Commit Message:
PS3: Stop using SDL mouse focus events to detect the XMB

Mouse focus events are also sent by SDL when the mouse is warped outside
of the window area. App suspended / resumed are now used. These are only
sent by SDL when opening / closing the XMB on the PS3.

Fixes #10340.

Changed paths:
    backends/events/ps3sdl/ps3sdl-events.cpp


diff --git a/backends/events/ps3sdl/ps3sdl-events.cpp b/backends/events/ps3sdl/ps3sdl-events.cpp
index 5065559..2aa2adb 100644
--- a/backends/events/ps3sdl/ps3sdl-events.cpp
+++ b/backends/events/ps3sdl/ps3sdl-events.cpp
@@ -36,33 +36,29 @@
  * This pauses execution and keeps redrawing the screen until the XMB is closed.
  */
 void PS3SdlEventSource::preprocessEvents(SDL_Event *event) {
-	if (event->type == SDL_WINDOWEVENT) {
-		if (event->window.event == SDL_WINDOWEVENT_LEAVE) {
-			// XMB opened
-			if (g_engine)
-				g_engine->pauseEngine(true);
+	if (event->type == SDL_APP_DIDENTERBACKGROUND) {
+		// XMB opened
+		if (g_engine)
+			g_engine->pauseEngine(true);
 
-			for (;;) {
-				if (!SDL_PollEvent(event)) {
-					// Locking the screen forces a full redraw
-					Graphics::Surface* screen = g_system->lockScreen();
-					if (screen) {
-						g_system->unlockScreen();
-						g_system->updateScreen();
-					}
-					SDL_Delay(10);
-					continue;
-				}
-				if (event->type == SDL_QUIT)
-					return;
-				if (event->type != SDL_WINDOWEVENT)
-					continue;
-				if (event->window.event == SDL_WINDOWEVENT_ENTER) {
-					// XMB closed
-					if (g_engine)
-						g_engine->pauseEngine(false);
-					return;
+		for (;;) {
+			if (!SDL_PollEvent(event)) {
+				// Locking the screen forces a full redraw
+				Graphics::Surface* screen = g_system->lockScreen();
+				if (screen) {
+					g_system->unlockScreen();
+					g_system->updateScreen();
 				}
+				SDL_Delay(10);
+				continue;
+			}
+			if (event->type == SDL_QUIT)
+				return;
+			if (event->type == SDL_APP_DIDENTERFOREGROUND) {
+				// XMB closed
+				if (g_engine)
+					g_engine->pauseEngine(false);
+				return;
 			}
 		}
 	}





More information about the Scummvm-git-logs mailing list