You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SDL2 not able to read the current display mode after a display mode is changed via wlr-randr or arandr (for Wayland SDL_GetDisplayMode error: "index must be in the range of 0 - -1")
#319
When I change the display mode using wlr-randr or arandr, it causes SDL2 applications to no longer be able to read the current display mode until they are restarted. The issue occurs both with the Wayland backend, where SDL_GetDisplayMode consistently returns the error:
index must be in the range of 0 - -1
and with the X11 backend, where SDL_GetDisplayMode starts returning the old mode, which does not match the actual one.
I'm using latest raspios with labwc on RPI4.
When I change the display mode using
wlr-randr
orarandr
, it causes SDL2 applications to no longer be able to read the current display mode until they are restarted. The issue occurs both with the Wayland backend, where SDL_GetDisplayMode consistently returns the error:and with the X11 backend, where SDL_GetDisplayMode starts returning the old mode, which does not match the actual one.
Steps to reproduce
sudo apt install libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev
test-vblank3.c
and copy/paste code (see below)gcc -o test-vblank3 test-vblank3.c -Wall -lGL -lSDL2 -lSDL2_ttf -lSDL2_image
./test-vblank3 --driver wayland
wlr-randr --output HDMI-A-1 --custom-mode 1280x1024@50Hz
)Expected result: SDL2 properly returns a new video mode
Actual result: For wayland backend SDL_GetDisplayMode fails with error. For x11 backend it returns incorrect video mode.
Screenshots
Test code
test-vblank3.c
The text was updated successfully, but these errors were encountered: