2022-08-29 19:27:32 +02:00
|
|
|
XWayland is the bridging mechanism between legacy Xorg programs and Wayland
|
|
|
|
compositors.
|
|
|
|
|
|
|
|
# HiDPI XWayland
|
|
|
|
|
2022-10-23 16:35:39 +02:00
|
|
|
XWayland currently looks pixelated/blurry on HiDPI screens, due to Xorg's
|
2022-08-29 19:27:32 +02:00
|
|
|
inability to scale.
|
2023-03-05 15:53:44 +01:00
|
|
|
There are attempts to add a standard scaling mechanism, such as
|
|
|
|
[MR 733](https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/733).
|
2022-08-29 19:27:32 +02:00
|
|
|
|
|
|
|
You can use this MR's wlroots implementation in Hyprland by making a few changes.
|
2023-03-05 15:53:44 +01:00
|
|
|
|
2022-08-29 19:27:32 +02:00
|
|
|
{{< hint >}}
|
|
|
|
The following instructions assume you know how to patch programs, either
|
|
|
|
manually or using your favourite package manager.
|
|
|
|
|
|
|
|
See instructions for [manual patching](https://www.howtogeek.com/415442/how-to-apply-a-patch-to-a-file-and-create-patches-in-linux/)
|
|
|
|
and [Pacman patching](https://wiki.archlinux.org/title/Patching_packages).
|
|
|
|
{{< /hint >}}
|
|
|
|
|
|
|
|
1. Have the latest `xwayland` package patched with at least
|
2022-10-23 16:35:39 +02:00
|
|
|
[the HiDPI patch](https://github.com/hyprwm/Hyprland/blob/main/nix/xwayland-hidpi.patch)
|
|
|
|
(based on the MR's implementation, but updated).
|
2022-08-29 19:27:32 +02:00
|
|
|
|
|
|
|
2. Make sure you have the required Hyprland `wlroots`, patched with
|
2023-03-05 15:53:44 +01:00
|
|
|
[the HiDPI xwayland patch](https://github.com/hyprwm/Hyprland/blob/main/nix/wlroots-hidpi.patch)
|
2022-10-23 16:35:39 +02:00
|
|
|
and [this commit](https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/18595000f3a21502fd60bf213122859cc348f9af)
|
2023-03-05 15:53:44 +01:00
|
|
|
**reverted**. This is important, as not reverting it will make opening
|
|
|
|
XWayland programs crash Hyprland.
|
2022-08-29 19:27:32 +02:00
|
|
|
|
2023-03-05 15:53:44 +01:00
|
|
|
3. Add these lines to your configuration:
|
2022-10-23 16:35:39 +02:00
|
|
|
|
2022-09-24 16:03:37 +02:00
|
|
|
```ini
|
2023-04-04 23:57:29 +02:00
|
|
|
|
|
|
|
# change monitor to hires, the last argument is the scale factor
|
|
|
|
monitor=,highres,auto,2
|
|
|
|
|
2023-03-05 15:53:44 +01:00
|
|
|
# sets xwayland scale
|
2022-08-29 19:27:32 +02:00
|
|
|
exec-once=xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2
|
2022-10-23 16:35:39 +02:00
|
|
|
|
2023-03-05 15:53:44 +01:00
|
|
|
# toolkit-specific scale
|
|
|
|
env = GDK_SCALE,2
|
|
|
|
env = XCURSOR_SIZE,32
|
2022-08-29 19:27:32 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
{{< hint >}}
|
2022-10-23 16:35:39 +02:00
|
|
|
The GDK_SCALE variable won't conflict with wayland-native GTK programs.
|
2022-08-29 19:27:32 +02:00
|
|
|
{{< /hint >}}
|