| Summary: | SDL_SetWindowFullscreen fails in legacy mode. | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Martín Golini <spartanj> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED ABANDONED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | solosnake |
| Version: | HG 2.0 | ||
| Hardware: | x86 | ||
| OS: | Linux | ||
|
Description
Martín Golini
2012-11-12 19:08:35 UTC
Marking a large number of bugs with the "triage-2.0.4" keyword at once. Sorry if you got a lot of email from this. This is to help me sort through some bugs in regards to a 2.0.4 release. We may or may not fix this bug for 2.0.4, though! This bug is still present in 2.0.5 (running on Linux Mint 17.3 Cinnamon).
It can easily reproduced by modifying one of the tests. I modified testdrawchessboard.c and inserted this into the loop() function:
if( e.type == SDL_TEXTINPUT ){
auto key = e.text.text[ 0 ];
if( key == 'f' ){
const Uint32 flag = SDL_WINDOW_FULLSCREEN_DESKTOP;
const int isfullscreen = 0 != ( SDL_GetWindowFlags( window ) & flag );
SDL_SetWindowFullscreen( window, isfullscreen ? 0 : flag );
}
}
Now pressing f key will cause the window to badly misbehave - it will minimise and will not be responsive.
As the original poster says, the issue seems to be in the legacy mode.
The problem begins here in SDL_x11window.c
void
X11_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * _display, SDL_bool fullscreen)
{
/* !!! FIXME: SDL_Hint? */
SDL_bool legacy = SDL_FALSE;
const char *env = SDL_getenv("SDL_VIDEO_X11_LEGACY_FULLSCREEN");
if (env) {
legacy = SDL_atoi(env);
} else {
SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
SDL_DisplayData *displaydata = (SDL_DisplayData *) _display->driverdata;
if ( displaydata->use_vidmode ) {
legacy = SDL_TRUE; /* the new stuff only works with XRandR. */
} else if ( !videodata->net_wm ) {
legacy = SDL_TRUE; /* The window manager doesn't support it */
} else {
/* !!! FIXME: look at the window manager name, and blacklist certain ones? */
/* http://stackoverflow.com/questions/758648/find-the-name-of-the-x-window-manager */
legacy = SDL_FALSE; /* try the new way. */
}
}
if (legacy) {
if (fullscreen) {
X11_BeginWindowFullscreenLegacy(_this, window, _display);
} else {
X11_EndWindowFullscreenLegacy(_this, window, _display);
}
} else {
X11_SetWindowFullscreenViaWM(_this, window, _display, fullscreen);
}
}
The X11_BeginWindowFullscreenLegacy misbehaves and sadly my x11 knowledge isn't good enough to understand why (I have stepped through it several times now).
In the above function (X11_SetWindowFullscreen) if I edit the code so that the 'legacy' variable remains false, then everything works.
So there appears to be two issues. One is that the x11 code is broken, and second is that the legacy mode should not be used on my system (?).
Being unable to fullscreen is a major problem and I am surprised this issue has existed since 2012 without a fix?
Thanks.
Hello, and sorry if you're getting dozens of copies of this message by email. We are closing out bugs that appear to be abandoned in some form. This can happen for lots of reasons: we couldn't reproduce it, conversation faded out, the bug was noted as fixed in a comment but we forgot to mark it resolved, the report is good but the fix is impractical, we fixed it a long time ago without realizing there was an associated report, etc. Individually, any of these bugs might have a better resolution (such as WONTFIX or WORKSFORME or INVALID) but we've added a new resolution of ABANDONED to make this easily searchable and make it clear that it's not necessarily unreasonable to revive a given bug report. So if this bug is still a going concern and you feel it should still be open: please feel free to reopen it! But unless you respond, we'd like to consider these bugs closed, as many of them are several years old and overwhelming our ability to prioritize recent issues. (please note that hundred of bug reports were sorted through here, so we apologize for any human error. Just reopen the bug in that case!) Thanks, --ryan. |