Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
obigu committed Nov 6, 2024
1 parent bfe060b commit fbe8129
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ public void invoke (long windowHandle, final boolean focused) {
postRunnable(new Runnable() {
@Override
public void run () {
if (config.pauseWhenLostFocus || windowListener != null) {
if (focused) {
if (config.pauseWhenLostFocus) {
synchronized (lifecycleListeners) {
Expand All @@ -70,9 +69,13 @@ public void run () {
}
listener.resume();
}
windowListener.focusGained();
if (windowListener != null) {
windowListener.focusGained();
}
} else {
windowListener.focusLost();
if (windowListener != null) {
windowListener.focusLost();
}
if (config.pauseWhenLostFocus) {
synchronized (lifecycleListeners) {
for (LifecycleListener lifecycleListener : lifecycleListeners) {
Expand All @@ -81,8 +84,7 @@ public void run () {
}
listener.pause();
}
}
Lwjgl3Window.this.focused = focused;
Lwjgl3Window.this.focused = false;
}
}
});
Expand Down

0 comments on commit fbe8129

Please sign in to comment.