hyprland-wiki/content/Configuring/XWayland.md

55 lines
1.7 KiB
Markdown
Raw Permalink Normal View History

---
2025-08-28 11:20:34 +02:00
weight: 17
title: XWayland
---
2022-08-29 20:27:32 +03:00
XWayland is the bridging mechanism between legacy Xorg programs and Wayland
compositors.
2023-08-02 00:02:05 +03:00
## HiDPI XWayland
2022-08-29 20:27:32 +03:00
2023-08-02 00:02:05 +03:00
XWayland currently looks pixelated on HiDPI screens, due to Xorg's inability to
scale.
2022-08-29 20:27:32 +03:00
This problem is mitigated by the
2024-03-17 14:44:39 +02:00
[`xwayland:force_zero_scaling`](../Variables/#xwayland) option,
which forces XWayland windows not to be scaled.
2023-03-05 16:53:44 +02:00
2023-08-02 00:02:05 +03:00
This will get rid of the pixelated look, but will not scale applications
properly. To do this, each toolkit has its own mechanism.
2022-08-29 20:27:32 +03:00
2023-08-02 00:02:05 +03:00
```ini
# change monitor to high resolution, the last argument is the scale factor
2024-07-30 22:59:15 +03:00
monitor = , highres, auto, 2
2022-08-29 20:27:32 +03:00
2023-08-02 00:02:05 +03:00
# unscale XWayland
xwayland {
force_zero_scaling = true
}
2022-08-29 20:27:32 +03:00
2023-08-02 00:02:05 +03:00
# toolkit-specific scale
env = GDK_SCALE,2
env = XCURSOR_SIZE,32
```
2022-08-29 20:27:32 +03:00
2023-08-02 00:02:05 +03:00
The GDK_SCALE variable won't conflict with Wayland-native GTK programs.
2025-10-29 20:52:11 +01:00
> [!WARNING]
> XWayland HiDPI patches are no longer supported. Do not use them.
## Abstract Unix domain socket
X11 applications use Unix domain sockets to communicate with XWayland. On Linux, libX11 prefers
to use the abstract Unix domain socket. This type of socket uses a separate, abstract namespace that
is independent of the host filesystem. This makes abstract sockets more flexible
but harder to [isolate](https://github.com/hyprwm/Hyprland/pull/8874)
for some kinds of sandboxes like Flatpak. However, removing the abstract socket
has [potential](https://gitlab.gnome.org/GNOME/mutter/-/issues/1613) security
and compatibility issues.
Keeping that in mind, we add the [`xwayland:create_abstract_socket`](../Variables/#xwayland) option.
When the abstract socket is disabled, only the regular Unix domain
socket will be created.
_\* Abstract Unix domain sockets are available only on Linux-based systems_