| Summary: | Linux: Fullscreen creates scrollable virtual desktop scrolled to random position by default | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Gerry JJ <trick> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | ASSIGNED --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | akeithw, boris.gjenero, deveee, icculus, wick.sebastian |
| Version: | HG 2.0 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
|
Description
Gerry JJ
2013-05-18 22:36:13 UTC
By the way, there's no SDL_GetWindowFullscreen function. Shouldn't there be? Er, never mind comment #1. I missed the SDL_GetWindowFlags function somehow. I have the same problem but only in specific cases: 1. This only happens if the fullscreen is not in the native resolution 2. Using only SDL_CreateWindow with SDL_WINDOW_FULLSCREEN 3. Does *NOT* occur if turning fullscreen off and on again with SDL_SetWindowFullscreen Ubuntu 14.04 LTS 64-bit, Unity desktop, nvidia binary driver. This still happens even with the latest code in hg. It is exactly like comment #3 describes and does not happen in SDL 1.2. (In reply to akeithw from comment #4) > Ubuntu 14.04 LTS 64-bit, Unity desktop, nvidia binary driver. > > This still happens even with the latest code in hg. It is exactly like > comment #3 describes and does not happen in SDL 1.2. After further testing for my setup this only appears to happen when moving from window mode to fullscreen if the resolution is not the native desktop resolution. Once you center the veiw with the mouse then there doesn't appear to be a problem I have done further testing. If I am going to full screen to a resolution of 800x600 from 1280x1024 and my mouse curser is not within the upper 800x600 region of my display at launch then my application "window" is not centered on the screen. So, I think it has to do with the warping of the mouse in Ubuntu. Using SDL 2.0.5 with 340.101-0ubuntu0.16.10.1 driver, SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN) results in a mode where the displayed area is larger than the resolution, and you can scroll around the video with the mouse. The view always starts off at the top left, cutting off the bottom and right part. I can view all SDL output properly by scrolling around, and there is no extra junk anywhere, but this is not a nice way to use an application. Then, if I'm not scrolled all the way up and all the way left, SDL_SetWindowFullscreen(window, 0) does not change the resolution. I'm returned to the desktop and with the SDL application in a window, but at the same low resolution that was used in full screen mode. Then I need to use xrandr to set the proper resolution. If the full screen display was scrolled all the way up and all the way left, then I don't get this problem. If I use the open source nouveau driver instead of the proprietary nvidia driver, none of these problems happen. It is how it works with nvidia and it's still broken for me on ubuntu 18.04... I was trying to disable panning with XRRSetPanning after setting crtc config, but the panning remains enabled. Actually XRRSetScreenSize works for me, but it may break multi-monitor configurations (I didn't test it yet). And anyway setting resolution with xrandr application works properly, so it should be possible to make a workaround. In SDL2, almost all cases where this happens are because the copy of SDL in use was built without XRandR support (or is being run on an Xserver that doesn't support XRandR, but that's significantly less likely). SDL uses XVidMode as a fallback in this case and tends to produce this result, and, eventually, I want to remove that codepath from SDL2 entirely. But for now: please make sure your SDL built correctly. It'll disable XRandR if you don't have the headers installed for it, which come from the libxrandr-dev package on Debian/Ubunty (and probably somewhere else on Fedora, etc...ymmv). (Note that in 2013, in Gerry's original bug report, this was probably just legitimately broken in SDL2, but this shouldn't be the case in modern times.) --ryan. Tbh. I didn't look that carefully at SDL2 code, but I have this problem with all SDL2-based games and actually I'm trying to fix it in Supertuxkart that uses xrandr with XRRSetCrtcConfig too. Other people have such issues too, for example: https://devtalk.nvidia.com/default/topic/951192/linux/panning-enabled-when-turning-fullscreen-with-xrrsetcrtcconfig/ I suppose that screen size must be manually set to correct value before crtc config is changed. Anyway I will make some tests... Here is a quick patch that works for me in STK: https://github.com/supertuxkart/stk-code/commit/26e7af3c23816bc056063fea9330468af03b9e30 Basically I turn off crtc, set screen size and then eventually set crtc mode. I'm not sure if computed screen size will be correct for some exotic configurations though (if someone has enabled panning/scaling/etc). And actually if someone has low resolution in system and wants to choose higher resolution in SDL, then you have to change screen size anyway, because they say: "The entire area of the CRTC must fit within the screen size, else a Match error results." And ideally I would like to find a way to disable panning, because it's much more simple. But XRRSetPanning just doesn't work... |