beyond-all-reason / beyond-all-reason/RecoilEngine

Flatpak x11 recevies unexpected SHOWN SDL window event

Open
#799 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
679
Forks
290
Avg merge
3d 1h
Merged PRs (30d)
38

Description

When the game gets minimized (doesn't matter if from Chobby or the game) SDL receives 3 events: Hidden, Hidden and Shown. When it gets maximized back it's 3 again: Shown, Shown and Shown.
The duplicated first two evenbts stem from handling both SDL_SHOWN and SDL_MAXIMIZED, but the third SHOWN is unexpected.
In consequence to additional event `globalRendering->active` is always active.
This issue does not occur on locally build spring without flatpak.
Environment: Flatpak, Fedora 37, x11
```
X.Org X Server 1.20.14
X Protocol Version 11, Revision 0
Build Operating System: 6.1.12-200.fc37.x86_64
Current Operating System: Linux *** 6.2.13-200.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Apr 26 20:15:56 UTC 2023 x86_64
Kernel command line: BOOT_IMAGE=(hd0,gpt2)/vmlinuz-6.2.13-200.fc37.x86_64 root=UUID=56925400-d1f4-47ae-a8f9-b03355855686 ro rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 initcall_blacklist=simpledrm_platform_driver_init mitigations=off rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 initcall_blacklist=simpledrm_platform_driver_init
Build Date: 29 March 2023 12:00:00AM
Build ID: xorg-x11-server 1.20.14-21.fc37
```

when it gets minimized:
```
[t=00:00:07.512233][f=-000001] [SpringApp::MainEventHandler][SDL_WINDOWEVENT_HIDDEN][1] fullScreen=0
[t=00:00:07.512243][f=-000001] [~ScopedOnceTimer][Sound::Iconified] 0ms
[t=00:00:07.512248][f=-000001] [SpringApp::MainEventHandler][SDL_WINDOWEVENT_HIDDEN][2]

[t=00:00:07.512254][f=-000001]
[t=00:00:07.512258][f=-000001] [SpringApp::MainEventHandler][SDL_WINDOWEVENT_HIDDEN][1] fullScreen=0
[t=00:00:07.512263][f=-000001] [~ScopedOnceTimer][Sound::Iconified] 0ms
[t=00:00:07.512268][f=-000001] [SpringApp::MainEventHandler][SDL_WINDOWEVENT_HIDDEN][2]

[t=00:00:07.512278][f=-000001]
[t=00:00:07.512283][f=-000001] [SpringApp::MainEventHandler][SDL_WINDOWEVENT_SHOWN][1] fullScreen=0
[t=00:00:07.512288][f=-000001] [~ScopedOnceTimer][Sound::Iconified] 0ms
[t=00:00:07.512294][f=-000001] [SpringApp::MainEventHandler][SDL_WINDOWEVENT_SHOWN][2]
```
when it gets maximized:
```
[t=00:02:56.806789][f=-000001] [SpringApp::MainEventHandler][SDL_WINDOWEVENT_SHOWN][1] fullScreen=0
[t=00:02:56.806822][f=-000001] [~ScopedOnceTimer][Sound::Iconified] 0ms
[t=00:02:56.806845][f=-000001] [SpringApp::MainEventHandler][SDL_WINDOWEVENT_SHOWN][2]

[t=00:02:56.806901][f=-000001]
[t=00:02:56.806929][f=-000001] [SpringApp::MainEventHandler][SDL_WINDOWEVENT_SHOWN][1] fullScreen=0
[t=00:02:56.806953][f=-000001] [~ScopedOnceTimer][Sound::Iconified] 0ms
[t=00:02:56.806973][f=-000001] [SpringApp::MainEventHandler][SDL_WINDOWEVENT_SHOWN][2]

[t=00:02:56.807501][f=-000001]
[t=00:02:56.807537][f=-000001] [SpringApp::MainEventHandler][SDL_WINDOWEVENT_SHOWN][1] fullScreen=0
[t=00:02:56.807567][f=-000001] [~ScopedOnceTimer][Sound::Iconified] 0ms
[t=00:02:56.807593][f=-000001] [SpringApp::MainEventHandler][SDL_WINDOWEVENT_SHOWN][2]
```

Contributor guide

Open the contributing guide

Research direction

The relevant entry point named in the logs is SpringApp::MainEventHandler; inspect its SDL_WINDOWEVENT_HIDDEN, SDL_WINDOWEVENT_SHOWN, and SDL_MAXIMIZED handling, especially updates to globalRendering->active and Sound::Iconified. Reproduce minimize and maximize under Flatpak on X11, and consider the issue done when duplicate or unexpected events no longer leave rendering active incorrectly.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.