From c64dc1c9c33fa6bb18cf36ce8fcefe3fbdf704a2 Mon Sep 17 00:00:00 2001 From: Gwilherm Folliot Date: Sat, 4 Oct 2025 22:36:10 +0200 Subject: [PATCH] protocols: Hyprland protocol expension for the Input Capture Desktop Portal (#8) Adds a protocol for EIS capture. --- meson.build | 1 + protocols/hyprland-input-capture-v1.xml | 155 ++++++++++++++++++++++++ 2 files changed, 156 insertions(+) create mode 100644 protocols/hyprland-input-capture-v1.xml diff --git a/meson.build b/meson.build index f509b6a..3a56eba 100644 --- a/meson.build +++ b/meson.build @@ -15,6 +15,7 @@ protocols = { 'hyprland-ctm-control': ['v1'], 'hyprland-surface': ['v1'], 'hyprland-lock-notify': ['v1'], + 'hyprland-input-capture': ['v1'], } protocol_files = [] diff --git a/protocols/hyprland-input-capture-v1.xml b/protocols/hyprland-input-capture-v1.xml new file mode 100644 index 0000000..24dbeb4 --- /dev/null +++ b/protocols/hyprland-input-capture-v1.xml @@ -0,0 +1,155 @@ + + + + Copyright © 2025 Fl0w + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + + This protocol is a bridge of the XDG input capture to the compositor. + + + + + This interface allows to create an input capture session. + + + + + Create a input capture session. + + + + + + + + + + Interface that is used to create barrier, and trigger capture and release of the pointer. + The inputs are sent through an EIS socket, when the cursor hit a barrier. + Barriers can only be placed on screen edges and need to be a straight line that cover one corner to another. + + + + + Remove every barriers from the session, new barriers need to be send before calling enable again. + + + + + + Add one barrier to the current session, the barrier need to a line placed on the edge of the screen, and is a straight line from one corner to another. + + + + + + + + + + + + + Enable the input capturing to be triggered by the cursor crossing a barrier. + + + + + + Disable input capturing, the crossing of a barrier will not trigger anymore input capture. + + + + + + Release input capturing, the input are not intercepted anymore and barrier crossing will activate it again. + If x != -1 and y != -1 then the cursor is warped to the x and y coordinates. + + + + + + + + + + This event provide the file descriptor of an eis socket where inputs will be sent when input capturing is active + + + + + + + + Called when the application will not receive captured input. The application can call enable to request future input capturing + + + + + + Called when the application is about to receive inputs + + + + + + + + + + + Called when input capture is stopped, and inputs are no longer sent to the application + + + + + + + + + + +