xdg-desktop-portal backend for Hyprland
  • C++ 93.5%
  • CMake 2.3%
  • Nix 2.1%
  • Meson 2.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Keith Yang 85450448ea
inputcapture: hand the EIS fd over instead of duplicating it (#449)
* inputcapture: hand the EIS fd over instead of duplicating it

sdbus::UnixFd(int) dups its argument, so ConnectToEIS sent the client a
copy while the session kept the original fd from the compositor forever.
That leaked the fd, and since xdph kept the client end of the socket
open, the compositor's EIS server never saw the client disconnect.

Adopt the fd into the reply and forget it, close it on session teardown
if ConnectToEIS was never called, and close a previous fd if the
compositor sends a new one.

* inputcapture: own the pending EIS fd with sdbus::UnixFd

Store the session's EIS fd in an owning sdbus::UnixFd instead of a raw
int. reset(fd, adopt_fd) closes any previous fd, moving it into the
ConnectToEIS reply hands ownership to the client, and the member's
destructor closes it if ConnectToEIS was never called, so the manual
close() calls and the SSession destructor go away.
2026-11-01 18:57:45 +01:00
.builds builds: add gbm and libdrm to the build environment 2022-04-10 13:38:01 +02:00
.github ci: init vouch 2026-08-01 12:25:46 +02:00
contrib CMake: get rid of Makefile and Ninja (#154) 2024-01-04 16:20:11 +01:00
hyprland-share-picker screencopy: add workspace sharing support (#441) 2026-10-21 18:27:48 +02:00
nix core: reimplement the picker in hyprtoolkit (#432) 2026-09-22 14:33:27 +02:00
protocols screencopy: add workspace sharing support (#441) 2026-10-21 18:27:48 +02:00
src inputcapture: hand the EIS fd over instead of duplicating it (#449) 2026-11-01 18:57:45 +01:00
subprojects screencopy: verify choices are valid for building modifier gbms (#447) 2026-10-20 19:37:48 +02:00
.clang-format Woo! Full rewrite, v1.0 release. (#78) 2023-09-06 20:36:48 +02:00
.editorconfig portals: Add missing buffer data flags SPA_DATA_FLAG_READABLE and SPA_DATA_FLAG_MAPPABLE. (#391) 2026-04-19 15:21:42 +01:00
.gitignore gitignore: reorder and label sections 2024-10-29 09:35:59 +02:00
.gitmodules Woo! Full rewrite, v1.0 release. (#78) 2023-09-06 20:36:48 +02:00
AGENTS.md agents: init agents.md 2026-05-30 11:36:59 +02:00
CMakeLists.txt screencopy: add workspace sharing support (#441) 2026-10-21 18:27:48 +02:00
CONTRIBUTING.md Fix link to trigger-screen-shot.py 2021-03-04 20:42:40 +01:00
flake.lock screencopy: add workspace sharing support (#441) 2026-10-21 18:27:48 +02:00
flake.nix core: reimplement the picker in hyprtoolkit (#432) 2026-09-22 14:33:27 +02:00
hyprland.portal input-capture: add portal implementation (#268) 2026-07-14 11:40:48 +02:00
LICENSE Woo! Full rewrite, v1.0 release. (#78) 2023-09-06 20:36:48 +02:00
meson.build input-capture: add portal implementation (#268) 2026-07-14 11:40:48 +02:00
meson_options.txt core: reimplement the picker in hyprtoolkit (#432) 2026-09-22 14:33:27 +02:00
org.freedesktop.impl.portal.desktop.hyprland.service.in CMake: get rid of Makefile and Ninja (#154) 2024-01-04 16:20:11 +01:00
README.md README: fix old wiki link 2024-10-23 10:08:19 +01:00
VERSION VERSION: bump to 1.5.0 2026-10-28 12:02:50 +01:00

xdg-desktop-portal-hyprland

An XDG Desktop Portal backend for Hyprland.

Installing

First, make sure to install the required dependencies:

gbm
hyprland-protocols
hyprlang
hyprutils
hyprwayland-scanner
libdrm
libpipewire-0.3
libspa-0.2
sdbus-cpp
wayland-client
wayland-protocols

Then run the build and install command:

git clone --recursive https://github.com/hyprwm/xdg-desktop-portal-hyprland
cd xdg-desktop-portal-hyprland/
cmake -DCMAKE_INSTALL_LIBEXECDIR=/usr/lib -DCMAKE_INSTALL_PREFIX=/usr -B build
cmake --build build
sudo cmake --install build

Nix

Caution

XDPH should not be used from this flake directly!

Instead, use it from the Hyprland flake.

There are two reasons for the above:

  1. Hyprland depends on XDPH, but XDPH also depends on Hyprland. This results in a cyclic dependency, which is a nightmare. To counter this, we use the Nixpkgs Hyprland package in this flake, so that it can be later consumed by the Hyprland flake while overriding the Hyprland package.
  2. Even if you manually do all the overriding, you may still get it wrong and lose out on the Cachix cache (which has XDPH as exposed by the Hyprland flake).

Running, FAQs, etc.

See the Hyprland wiki