Skip to content

xwayland: support HiDPI scale #6446

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

moetayuko
Copy link

@moetayuko moetayuko commented Jun 12, 2024

Describe your PR, what does it fix/add?

This supports the xorg-xwayland patch at https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/733

Ported from https://gitlab.freedesktop.org/lilydjwg/wlroots/-/commit/5a7c65cab11c9f3c3dc79f9c4cfb8a6acf6cbaae

See #6281 for motivation.

AUR package hyprland-hidpi-xprop-git applies this patch on top of hyprland mainline. After installing, do the following to enable (scaling factor 2 in this example):

  1. Add exec-once = systemctl --user start xsettingsd.service && echo "Xft.dpi: 192" | xrdb -merge && xprop -root -format _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2 to hyprland configuration.
  2. Add the following to ~/.config/xsettingsd/xsettingsd.conf
    Gdk/UnscaledDPI 98304
    Gdk/WindowScalingFactor 2
    
  3. Remove GDK_SCALE, QT_SCALE_FACTOR, and other per-application scaling options.

Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)

N/A

Is it ready for merging, or does it need work?

No, for cherry-pick only

@vaxerski
Copy link
Member

what advantages does this have over force_zero_scaling?

@moetayuko
Copy link
Author

what advantages does this have over force_zero_scaling?

Quoting from my description in #6281:

The official Xwayland scaling solution xwayland:force_zero_scaling does not support multi-monitor with different scale factors. Specifically, when having two monitors of scale factors 2 and 1, Xwayland apps look good on the one of scale factor 2, but 2x larger on the one of scale factor 1.

@alexhulbert
Copy link

What is required to get this into a state where it can be merged? I would love to see this feature merged into Hyprland.

@ParaN3xus
Copy link
Contributor

It's broken on latest Hyprland. XWayland appliacations squeezed to left top cornor of their window frame.

@moetayuko
Copy link
Author

It's broken on latest Hyprland. XWayland appliacations squeezed to left top cornor of their window frame.

I'm on vacation and don't have a hyprland device on hand to investigate the fix.

@moetayuko
Copy link
Author

It's broken on latest Hyprland. XWayland appliacations squeezed to left top cornor of their window frame.

I'm on vacation and don't have a hyprland device on hand to investigate the fix.

fixed

@ParaN3xus
Copy link
Contributor

Thank you for your work. I noticed that this PR has caused issue #5561 to reappear. Would you mind also taking a look at this issue?

@moetayuko
Copy link
Author

Thank you for your work. I noticed that this PR has caused issue #5561 to reappear. Would you mind also taking a look at this issue?

does this work for you?
patch.txt

@ParaN3xus
Copy link
Contributor

It works! Thank you!

@stupidratcreature1000
Copy link

The cursor is a little odd on Sober (roblox thingy for linux, it's a flatpak) I only experience this issue ingame and not in the game browser menus or guis

@Nojike
Copy link

Nojike commented Apr 3, 2025

xwayland windows have cursors size smaller than when on wayland but not tiny as 24 pixel on a unscaled 4k screen.

@Dreamail
Copy link

Dreamail commented Apr 10, 2025

Font cracking and the mouse input was in a wrong position. I pick your commit base on the last Hyprland.

EDIT: same problem with your repo builds

Fixed. I was not add the patched xwayland package into the system. And the nixpkgs seems to have some bug in overriding pkgs.
But the font is still cracking.

Fixed again with xwayland:use_nearest_neighbor = false

Dreamail added a commit to Dreamail/nixos-config that referenced this pull request Apr 11, 2025
…refectly

read hyprwm/Hyprland#6446 for more details
xcursor size has to scale to x2 by app, because the env var `XCURSOR_SIZE` is also read by wayland apps.
@Nojike
Copy link

Nojike commented Apr 17, 2025

xwayland windows have cursors size smaller than when on wayland but not tiny as 24 pixel on a unscaled 4k screen.

fixed by installed hyprcursor and set xcursor env correctly.

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

Successfully merging this pull request may close these issues.

7 participants