Fix Daemon on XWayland#659
Conversation
|
Alternatively there is this patch diff --git a/src/engine/sys/sdl_glimp.cpp b/src/engine/sys/sdl_glimp.cpp
index 1500e7cd..f14662d0 100644
--- a/src/engine/sys/sdl_glimp.cpp
+++ b/src/engine/sys/sdl_glimp.cpp
@@ -522,8 +522,14 @@ static bool GLimp_DetectAvailableModes()
if ( SDL_GetWindowDisplayMode( window, &windowMode ) < 0 )
{
+ // we can't use SDL_GetWindowWMInfo yet, so we can't use
+ // that and use getenv instead.
+ if (Q_stricmp(getenv("XDG_SESSION_TYPE"), "wayland") == 0)
+ {
+ return true; // don't fail as this is normal on XWayland.
+ }
logger.Warn("Couldn't get window display mode: %s", SDL_GetError() );
- return true;
+ return false;
}
for ( i = 0; i < SDL_GetNumDisplayModes( display ); i++ ) |
4509704 to
d743254
Compare
|
By doing that you fix one issue but bring back others (including segmentation faults). One issue is described in the code itself here:
It looks like what you get is a variant of the issue described in PR #644 (now replaced by PR #657). |
|
If we're gonna make this test return The purpose of this function being a @necessarily-equal What happens if you run latest master on Wayland, including the just merged: Does it return to a safe resolution? Note that this is not a fix for the issue you experience, but it would help to understand more what's going on. |
|
@necessarily-equal can you add this simple comment above the I assume it's better to give everyone the ability to open a window with an arbitrary size than preventing a crash that is only likely to happens on some obsolete hardware if the user tries to use an higher resolution than his GPU can do (which is expected to be already larger than his screen, so not something he wants). We can do better things after 0.53, 0.52 didn't catch the said crash so not catching this crash in 0.53 isn't a regression, while preventing the creation of arbitrary window sizes is a regression. |
|
Sounds good. I'll be afk tomorrow, you can push this to the PR and merge it if you want to proceed with the release
Le 27 juillet 2022 19:00:47 GMT+02:00, Thomas Debesse ***@***.***> a écrit :
***@***.*** can you add this simple comment above the `return true;` line
…
```
/* FIXME: returning true means the engine will crash if the window size is larger than what the GPU can do,
but we need to not fail to open window that are not using native screen resolutions even if the GPU can handle it. */
```
I assume it's better to give everyone the ability to open a window with an arbitrary size than preventing a crash that is only likely to happens on some obsolete hardware if the user tries to use an higher resolution than his GPU can do (which is expected to be already larger than his screen, so not something he wants).
We can do better things after 0.53, 0.52 didn't catch the said crash so not catching this crash in 0.53 isn't a regression, while preventing the creation of arbitrary window sizes is a regression.
--
Reply to this email directly or view it on GitHub:
#659 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
|
merged as ba35389 |
Fixes #658