Skip to content

linux: handle desktop dpi scaling - #1010

Open
guanqun wants to merge 1 commit into
EpicGames:masterfrom
guanqun:linux-dpi-scaling
Open

guanqun wants to merge 1 commit into
EpicGames:masterfrom
guanqun:linux-dpi-scaling

Conversation

@guanqun

@guanqun guanqun commented Oct 9, 2026

Copy link
Copy Markdown

this is my first attempt to fix the dpi scaling on my linux desktop. GNOME desktop.

In this implementation, only the Xresources is queried, I'm not sure if we should do the xsettings parsing as well (there are some binary formatting there.) Happy to add it if you think it's required.

- linux_window_manager: resolve the screen-global dpi from the Xft.dpi X
  resource on the root window (kept in sync by the desktop's settings
  daemon), cache it, and refresh on RESOURCE_MANAGER PropertyNotify;
  report it from wm_dpi_from_window/wm_dpi_from_monitor
- raddbg_core: seed each window's last-dpi from the dpi its font size was
  authored for (window cfg 'dpi' node, default 96), so the first frame
  normalizes the font size on differently-scaled desktops (e.g. hidpi
  xwayland) without double-scaling on restart
@guanqun
guanqun force-pushed the linux-dpi-scaling branch from 8c70392 to d5edb8c Compare October 9, 2026 07:16
@diniamo

diniamo commented Oct 10, 2026

Copy link
Copy Markdown

Tested, works nicely for me.

@guanqun I was also trying to make this work as well before finding your PR. Do you know why simply using XGetDefault won't return an updated value until I restart the app? The documentation I found wasn't very helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants