From bfe060b3e38efe188b72c8f61e2968ae5d623d7d Mon Sep 17 00:00:00 2001 From: obigu Date: Mon, 4 Nov 2024 12:22:30 +0100 Subject: [PATCH] Fix pauseWhenLostFocus not working as expected --- CHANGES | 1 + .../src/com/badlogic/gdx/backends/lwjgl3/Lwjgl3Window.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 428dadeffc9..a29f3d6dc9d 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,7 @@ - iOS: Update to MobiVM 2.3.22 - Change visibility of PolygonSpriteBatch.switchTexture() to protected - Added XmlReader.getChildren() and XmlReader.replaceChild() +- LWJGL3: Fix pauseWhenLostFocus not working as expected [1.13.0] - [BREAKING CHANGE] GWT: Updated to 2.11.0. `com.google.jsinterop:jsinterop-annotations:2.0.2:sources` must be added as a dependency to your html project dependencies. diff --git a/backends/gdx-backend-lwjgl3/src/com/badlogic/gdx/backends/lwjgl3/Lwjgl3Window.java b/backends/gdx-backend-lwjgl3/src/com/badlogic/gdx/backends/lwjgl3/Lwjgl3Window.java index fb3258db9f1..06fad51f2b8 100644 --- a/backends/gdx-backend-lwjgl3/src/com/badlogic/gdx/backends/lwjgl3/Lwjgl3Window.java +++ b/backends/gdx-backend-lwjgl3/src/com/badlogic/gdx/backends/lwjgl3/Lwjgl3Window.java @@ -60,7 +60,7 @@ public void invoke (long windowHandle, final boolean focused) { postRunnable(new Runnable() { @Override public void run () { - if (windowListener != null) { + if (config.pauseWhenLostFocus || windowListener != null) { if (focused) { if (config.pauseWhenLostFocus) { synchronized (lifecycleListeners) { @@ -68,6 +68,7 @@ public void run () { lifecycleListener.resume(); } } + listener.resume(); } windowListener.focusGained(); } else {