From a3d1d4860df4bf4056bde1a7f5b043a5e7b851d0 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 13 Dec 2023 14:57:57 +1000 Subject: [PATCH] Handle OEFFIS_DEVICE_ALL_DEVICES correctly --- ...VICE_ALL_DEVICES-should-translate-to.patch | 36 +++++++++++++++++++ libei.spec | 7 +++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 0001-oeffis-OEFFIS_DEVICE_ALL_DEVICES-should-translate-to.patch diff --git a/0001-oeffis-OEFFIS_DEVICE_ALL_DEVICES-should-translate-to.patch b/0001-oeffis-OEFFIS_DEVICE_ALL_DEVICES-should-translate-to.patch new file mode 100644 index 0000000..f56d9a7 --- /dev/null +++ b/0001-oeffis-OEFFIS_DEVICE_ALL_DEVICES-should-translate-to.patch @@ -0,0 +1,36 @@ +From 5812782885624648d3d198edab5af314abadfee4 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Wed, 13 Dec 2023 13:31:00 +1000 +Subject: [PATCH] oeffis: OEFFIS_DEVICE_ALL_DEVICES should translate to "all" + +As the portal documentation [1] says: + Bitmask of what device types to request remote controlling of. Default is all. + +The default is only triggered if we do not submit the types at all, the +current behavior of sending a value of 0 means "none". Fix this by +skipping the "types" key if we try to select for all devices. + +[1] https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.impl.portal.RemoteDesktop.html + +Signed-off-by: Peter Hutterer +--- + src/liboeffis.c | 2 +- + test/test_oeffis.py | 24 ++++++++++++++++++++++++ + 2 files changed, 25 insertions(+), 1 deletion(-) + +diff --git a/src/liboeffis.c b/src/liboeffis.c +index 93b83176..7d2ec353 100644 +--- a/src/liboeffis.c ++++ b/src/liboeffis.c +@@ -560,7 +560,7 @@ portal_select_devices(struct oeffis *oeffis) + &response, + "oa{sv}", + oeffis->session_path, +- 2, ++ oeffis->devices == OEFFIS_DEVICE_ALL_DEVICES ? 1 : 2, + "handle_token", /* string key */ + "s", token, /* variant string */ + "types", /* string key */ +-- +2.43.0 + diff --git a/libei.spec b/libei.spec index 2393fd2..eaec4e6 100644 --- a/libei.spec +++ b/libei.spec @@ -5,7 +5,7 @@ Name: libei Version: 1.2.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Library for Emulated Input License: MIT @@ -23,6 +23,8 @@ BuildRequires: python3-jinja2 BuildRequires: python3-rpm-macros BuildRequires: systemd-devel +Patch01: 0001-oeffis-OEFFIS_DEVICE_ALL_DEVICES-should-translate-to.patch + # libei packages %description libei is a library to Emulate Input. It allows clients to talk to @@ -121,6 +123,9 @@ Library for XDG RemoteDesktop Portal Setup Development Package %{_bindir}/ei-debug-events %changelog +* Wed Dec 13 2023 Peter Hutterer - 1.2.0-2 +- Handle OEFFIS_DEVICE_ALL_DEVICES correctly + * Wed Dec 06 2023 Peter Hutterer - 1.2.0-1 - libei 1.2.0