Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x11 regression: SDL_SetWindowSize fails to properly resize if SDL_SetWindowMinimumSize is called afterward #11754

Closed
slime73 opened this issue Dec 27, 2024 · 2 comments · Fixed by #11756
Assignees
Milestone

Comments

@slime73
Copy link
Contributor

slime73 commented Dec 27, 2024

If I create a window and set up some window state, and then later do something like this:

SDL_SetWindowSize(window, 256, 256);
SDL_SetWindowMinimumSize(window, 1, 1);

It reverts back to the original window size on x11. It seems to be working fine on macOS and Windows. I'm not sure about Wayland. If I comment out the SDL_SetWindowMinimumSize call then it resizes properly on x11.

I believe this regression was introduced with #11639 (fyi @Kontrabant)

I first noticed this in love's automated tests (https://github.com/love2d/love/actions/runs/12496817150/job/34871183100) - and then I set up WSL2 and did some testing and reduced it down from the other stuff love does inside its love.window.setMode call to just this LuaJIT code run inside love. I don't have a plain C repro but I hope that's enough to go from:

ffi = require("ffi")

ffi.cdef[[
typedef struct SDL_Window SDL_Window;

bool SDL_SetWindowSize(SDL_Window *window, int w, int h);
bool SDL_SetWindowMinimumSize(SDL_Window *window, int min_w, int min_h);
]]

local window = ffi.cast("SDL_Window *", love.window.getPointer())

ffi.C.SDL_SetWindowSize(window, 256, 256)
ffi.C.SDL_SetWindowMinimumSize(window, 1, 1)
@Kontrabant
Copy link
Contributor

Fixed. This was a problem with setting the max size with the same pattern as well.

@slime73
Copy link
Contributor Author

slime73 commented Dec 28, 2024

Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants