Daemon icon indicating copy to clipboard operation
Daemon copied to clipboard

Unclickable fatal error message (Windows and macOS)

Open slipher opened this issue 1 year ago • 13 comments

When I got an error starting the cgame VM on startup (Error during initialization: VM: Could not create child process: Access is denied), the fatal error dialog box was created "in" the full-screen window (where nothing was drawn yet). The full-screen window was not yet focused, so the dialog was initially not visible. By clicking on Unvanquished in the taskbar it was possible to focus the window and see the dialog drawn over a black screen, but it was not possible to interact with it using mouse or keyboard. Normal methods for closing also do not work during the fatal error dialog, so it had to be closed using the Task Manager. This is on Windows 10.

slipher avatar Sep 28 '24 05:09 slipher

An easy way to produce the error is to pass -set vm.cgame.type 2 but don't actually build the native exe.

slipher avatar Sep 28 '24 05:09 slipher

Ah yes I reproduced it last time I tried Windows but forgot to report it! Clicking the icon in the taskbar brings the fullscreen game up but cycling to the error message brings the fullscreen game down and the error messages goes down with it… 🙃️

We may also have to check if such bad behavior happens on GNOME when modal attachment is enabled (I always disable this bad feature because of this kind of bad behavior with all apps).

illwieckz avatar Sep 28 '24 06:09 illwieckz

This started happening sometime this year, at the start of the year it was still working fine. I haven't seen black screen with it, rather just the window getting minimised and mouse position being reset to the top left of the screen when trying to click on it.

VReaperV avatar Sep 29 '24 07:09 VReaperV

This may even be something having changed in SDL2 or in Windows.

illwieckz avatar Sep 29 '24 07:09 illwieckz

0.54.1 still works fine in this regard, so I don't think it's an OS change.

VReaperV avatar Sep 29 '24 07:09 VReaperV

I rebooted and now I can't reproduce it anymore... the difference is that the full-screen window is focused right away. The bug happened when the dialog came up while the application was in a minimized and full-screen state

Never mind just forgot to set r_fullscreen 1

slipher avatar Sep 30 '24 04:09 slipher

There may be a way to fix the focusing issue, but I believe a better solution would be to entirely destroy the game window on Sys::Error (if that's possible).

illwieckz avatar Oct 01 '24 10:10 illwieckz

There may be a way to fix the focusing issue, but I believe a better solution would be to entirely destroy the game window on Sys::Error (if that's possible).

Not really. Sys::Error is used for things like segfaults so we don't want to do a lot of stuff.

If it turns out this bug can only happen in a narrow window of the loading phase, maybe we could reduce that window by doing a miminal initialization of the cgame (like just the CGAME_STATIC_INIT call) before starting the renderer.

slipher avatar Oct 02 '24 01:10 slipher

I've found this: https://github.com/libsdl-org/SDL/issues/5371, maybe that's the reason?

VReaperV avatar Oct 14 '24 22:10 VReaperV

I've found this: libsdl-org/SDL#5371, maybe that's the reason?

Yeah that seems to be it. Maybe after the release I'll update all the external_deps and see if that fixes it.

slipher avatar Oct 14 '24 22:10 slipher

I no longer get this issue when building from master.

VReaperV avatar Jan 27 '25 15:01 VReaperV

I got this on Mac on master when nacl_loader was missing.

slipher avatar Mar 07 '25 05:03 slipher

Updating to SDL 2.32.2 does not fix it on Windows. On second glance, https://github.com/libsdl-org/SDL/issues/5371 is not relevant because it concerns SDL_WINDOW_FULLSCREEN_DESKTOP which is the "Mac OS fullscreen" from https://github.com/Unvanquished/Unvanquished/issues/790.

As a reminder, the bug can be produced by ./daemon -set vm.cgame.type 2 -set r_fullscreen 1 if you have not built the native exe.

slipher avatar Apr 20 '25 06:04 slipher

It seems that on Windows this happens any time there is a Sys::Error in full-screen mode. Not just at a special point during loading where the window is not fully initialized or something...

slipher avatar Aug 17 '25 00:08 slipher

The Linux error popup is somewhat broken too, even in windowed mode. You can interact with it only by clicking X. The "OK" button doesn't work.

slipher avatar Aug 20 '25 01:08 slipher

Seems to be fixed with SDL3 on Windows.

On Mac I can't produce it now even with SDL2.

slipher avatar Sep 21 '25 09:09 slipher

Yeah!

illwieckz avatar Sep 21 '25 14:09 illwieckz