-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Source buffer out of bounds using Wayland viewporter with fractional scaling #9283
Comments
The above patch is for SDL2 |
The viewport is now set to always use the entire buffer, so this shouldn't happen anymore. Most likely what was happening was that Wayland events would be processed internally due to some call that invoked a round trip, and the window would be resized along with the viewport, but the client wouldn't check SDL events and get the notification until the next frame, after a buffer with the old size was committed. You example basically forced the issue by resizing the window without querying and resizing the backbuffer. You didn't see the issue with scaling off, because SDL2 doesn't create a viewport for unscaled windows. |
Thanks for the quick fix! |
If the
SDL_WINDOW_ALLOW_HIGHDPI
window flag is set while fractional scaling is taking place under wayland (therefore wl_viewporter is in use), then the window is resized to be larger,wp_viewport@33: error 2: source rectangle out of buffer bounds
is logged and the program crashes.I can reproduce the issue with the following diff on the
testgl2.c
test:When running with
WAYLAND_DEBUG=1
, we can see the following happen:The viewport is set up with the initial window size
The viewport is reconfigured with the new window size
A frame buffer of the original window size which is too small to be the viewport source is created, attached, and commited:
I noticed that without the enabling of fractional scaling, a small framebuffer is still used but does not cause issues on swap. Maybe this is something that should be allowed by wlroots?
Downstream, this issue affects both osu-lazer and Factorio for me, and has been ever since the bounds checking was added in wlroots.
The text was updated successfully, but these errors were encountered: