SDL icon indicating copy to clipboard operation
SDL copied to clipboard

Wayland scaling causes the display picture to scale down

Open figuld opened this issue 2 years ago • 3 comments

Using sway (swayfx) with output eDP-1 scale 1.5 (the issue is also present on output eDP-1 scale 2).

The scaling causes the picture's height and width to be reduced by the scale factor and the remaining window space to have black borders (on the top and right). Only the picture itself is scaled down, the window interaction is not, e.g. to press a button I need to position the cursor where the button would have been if the picture was displaying normally.

Turning off scaling fixes it. Also, since setting SDL_VIDEO_DRIVER=x11 fixes it as well, I'm assuming, it's the SDL bug, not the application bug.

See https://github.com/minecraft-linux/mcpelauncher-manifest/issues/981#issuecomment-2143605846 for logs and more details.

The issue isn't present on xonotic-sdl which uses sdl 2.30.3-1, so it seems to be SDL3 specific.

figuld avatar Jun 02 '24 09:06 figuld

What appears to be happening from that log:

  1. The game creates a resizable window of size 720x480
  2. The window manager resizes the window to 1428x910 ('tiled' to the desktop dimensions)
  3. The game continues rendering at 720x480 to a portion of the new backbuffer size

Basically, it looks like the game (or something else) sets the resizable flag on the window, but the game doesn't adjust its rendering when receiving resize events.

Kontrabant avatar Jun 02 '24 12:06 Kontrabant

yes this is not a sdl3 bug, I wouldn't have reported it here as it's experimental untested binding.

The x11 backend doesn't seem to forward the scaling to the app, while wayland backend forwards scaling to the app.

ChristopherHX avatar Jun 02 '24 12:06 ChristopherHX

Ok, we can close this then. Thanks for confirming.

Kontrabant avatar Jun 02 '24 13:06 Kontrabant