Aspect ratio + min size constraints issue
If both aspect ratio and minimum size constraints are applied, resizing causes the window size to "jump":
#include <SDL3/SDL.h>
int main(void) {
// No error handling on purpose
SDL_Init(SDL_INIT_VIDEO);
SDL_Window *window;
SDL_Renderer *renderer;
SDL_CreateWindowAndRenderer("SDL", 800, 500, SDL_WINDOW_RESIZABLE, &window, &renderer);
float ar = 800.f / 500;
SDL_SetWindowAspectRatio(window, ar, ar);
SDL_SetWindowMinimumSize(window, 400, 250);
SDL_Event event;
while (SDL_WaitEvent(&event)) {
switch (event.type) {
case SDL_EVENT_WINDOW_EXPOSED:
SDL_RenderClear(renderer);
SDL_RenderPresent(renderer);
break;
case SDL_EVENT_QUIT:
return 0;
}
}
return 0;
}
gcc sample.c -lSDL3 -o sample && ./sample
(SDL 3.4.4 on Debian 14 forky/sid)
Issue first posted for SDL: https://github.com/libsdl-org/SDL/issues/15449
But it seems it is an XFCE bug: https://github.com/libsdl-org/SDL/issues/15449#issuecomment-4319897269