Fix leaving fullscreen creates window at (0,0)#2460
Conversation
Depending on the window manager, it already worked (but only when you compile from source and link against system SDL), or it can't be made to work (when you have a non-compliant window manager). I'll test it on Ubuntu's flavour of Gnome Shell under X and Wayland and report back... |
|
I think everything is fixed now. I had a lot of trouble getting it to work until I moved the "Set_WindowPosition" under the "SDL_SetWindowFullscreen" - which makes sense. The whole cause of this trouble was fullscreen windows not holding locations, so windows coming out of fullscreen need to be repositioned after they leave fullscreen. I've been testing with the example code in the issue. To test it starting in fullscreen change line 12: |
|
Looks like the crash in Travis is unrelated, and seems to be crashing in lots of other PRs. |
Works for me on the gorilla Ubuntu with default settings, with pygame compiled from source. |
|
Not sure what changed from Pygame 2.0.0 to 2.0.1, but there's still an issue with this on windows 10. My version is: pygame 2.0.1, using SDL 2.0.14, python 3.9.4 with windows 10. |
Targeted to fix #2360.
Over the past day I've been investigating issue #2360.
The window created inside
set_mode()is supposed to get its position from the last window, if it exists.The problem is that if the last window is a fullscreen window,
SDL_GetWindowPosition()returns (0, 0).Perhaps in SDL1 the window position values were saved in fullscreen windows, despite not being "real" - fullscreen windows don't have a position on the screen - they are the screen.
This solution works on Windows 10 and Mac.
Further things: