Files
raylib/src
paddy 4678a544b6 [rcore][glfw] Fix window scaling on Wayland with GLFW 3.4+ (#5564)
* Fix window scaling on Wayland with GLFW 3.4+ display scaling

GLFW 3.4 defaults GLFW_SCALE_FRAMEBUFFER to TRUE on all platforms,
causing framebuffer/window size mismatch on Wayland with display
scaling (content renders in a subset of the window, mouse coordinates
are wrong).

Three fixes:
- Disable GLFW_SCALE_FRAMEBUFFER on Wayland when FLAG_WINDOW_HIGHDPI
  is not set, restoring 1:1 window-to-framebuffer mapping
- With FLAG_WINDOW_HIGHDPI, read actual framebuffer size from GLFW
  instead of resizing the window (which double-scales on Wayland
  where GLFW_SCALE_TO_MONITOR has no effect)
- Skip mouse coordinate scaling on Wayland since GLFW already reports
  coordinates in logical (window) space

Tested on NixOS/Niri with GLFW 3.4 at 1x, 1.5x, and 2x scaling.

Fixes #5504

* Fix fullscreen and borderless windowed scaling on Wayland with HiDPI

ToggleFullscreen and ToggleBorderlessWindowed exit paths manually
scale screen size by DPI before passing to glfwSetWindowMonitor,
which double-scales on Wayland where GLFW_SCALE_FRAMEBUFFER already
handles it. Skip the manual resize on Wayland.

Also fix FramebufferSizeCallback fullscreen branch: on Wayland with
GLFW_SCALE_FRAMEBUFFER the framebuffer is still scaled in fullscreen,
so use the logical window size as screen size and derive screenScale
from the framebuffer/window ratio.

Fixes #5504

* Apply style fixes from code review: remove duplicate screenScale assignment, collapse single-statement ifs to one line, remove trailing periods from comments
2026-02-17 12:43:52 +01:00
..
2026-02-12 19:08:48 +01:00
2026-01-10 12:20:26 +01:00
2026-02-14 22:17:49 +01:00
2025-12-30 22:05:37 +01:00
2025-01-01 00:02:52 +01:00
2025-01-01 00:02:52 +01:00
2026-02-12 18:55:42 +01:00
2024-11-14 16:40:04 +01:00
2025-01-01 00:02:52 +01:00
2025-01-01 00:02:52 +01:00
2026-02-14 22:16:09 +01:00
2026-01-02 13:40:15 +01:00
2026-01-02 13:40:15 +01:00
2026-02-09 22:23:23 +01:00
2026-02-14 22:22:31 +01:00
2026-01-09 23:09:06 +01:00