Compare commits

...

12 commits
v0.6.1 ... main

Author SHA1 Message Date
3f3860b869
meson -> cmake 2025-12-08 19:25:53 +02:00
bd153e76f7
version: bump to 0.7.0 2025-10-04 21:37:23 +01:00
9c487e11c1
README: add new EIS protocol to readme 2025-10-04 21:37:11 +01:00
Gwilherm Folliot
c64dc1c9c3
protocols: Hyprland protocol expension for the Input Capture Desktop Portal (#8)
Adds a protocol for EIS capture.
2025-10-04 22:36:10 +02:00
Chris Hixon
613878cb6f
README: Add build instructions (#19)
Change headings to h2
2025-06-04 15:18:34 +01:00
3a5c2bda1c version: bump to 0.6.4 2025-04-03 22:14:34 +01:00
WhySoBad
04428d6b90
fix: add toplevel mapping protocol to meson build (#17) 2025-04-03 21:10:26 +02:00
4ab17ccac0 version: bump to 0.6.3 2025-04-02 00:14:11 +01:00
9cb87767de README: add hyprland_toplevel_mapping 2025-04-02 00:13:57 +01:00
WhySoBad
9830bfb56f
protocols: Add toplevel mapping protocol (#16) 2025-04-02 00:53:55 +02:00
755aef8dab version: bump to 0.6.2 2025-02-01 15:10:29 +00:00
6c520135a9
protocols: add hyprland_ctm_control_manager_v1.blocked (#14) 2025-02-01 16:09:57 +01:00
8 changed files with 350 additions and 72 deletions

41
CMakeLists.txt Normal file
View file

@ -0,0 +1,41 @@
cmake_minimum_required(VERSION 3.20)
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" HYPRLAND_PROTOCOLS_VERSION
LIMIT_COUNT 1)
string(STRIP "${HYPRLAND_PROTOCOLS_VERSION}" HYPRLAND_PROTOCOLS_VERSION)
project(
hyprland-protocols
VERSION ${HYPRLAND_PROTOCOLS_VERSION}
LANGUAGES NONE)
include(GNUInstallDirs)
set(PROTOCOL_FILES
protocols/hyprland-toplevel-export-v1.xml
protocols/hyprland-global-shortcuts-v1.xml
protocols/hyprland-focus-grab-v1.xml
protocols/hyprland-ctm-control-v1.xml
protocols/hyprland-surface-v1.xml
protocols/hyprland-lock-notify-v1.xml
protocols/hyprland-toplevel-mapping-v1.xml
protocols/hyprland-input-capture-v1.xml)
foreach(PROTOCOL_FILE ${PROTOCOL_FILES})
get_filename_component(PROTOCOL_DIR ${PROTOCOL_FILE} DIRECTORY)
install(
FILES ${PROTOCOL_FILE}
DESTINATION "${CMAKE_INSTALL_DATADIR}/hyprland-protocols/${PROTOCOL_DIR}")
endforeach()
# Configure pkg-config file
set(prefix "${CMAKE_INSTALL_PREFIX}")
set(datarootdir "\${prefix}/${CMAKE_INSTALL_DATADIR}")
set(abs_top_srcdir "${CMAKE_CURRENT_SOURCE_DIR}")
set(PACKAGE "hyprland-protocols")
configure_file(hyprland-protocols.pc.in hyprland-protocols.pc @ONLY)
# Install pkg-config file
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/hyprland-protocols.pc"
DESTINATION "${CMAKE_INSTALL_DATADIR}/pkgconfig")

View file

@ -1,4 +1,5 @@
# hyprland-protocols
Wayland protocol extensions for Hyprland.
This repository exists in an effort to bridge the gap between Hyprland and KDE/Gnome's functionality,
@ -9,15 +10,27 @@ a set of protocols Hyprland uses to plumb some things / add some useful features
Some of the protocols here also do not belong in w-p, as they are specific to Hyprland.
# Finished protocols
## Finished protocols
- `hyprland_toplevel_export` -> for exporting toplevel buffers (aka. windows) for screensharing
- `hyprland_global_keybindings` -> for managing global keybinds via D-Bus.
- `hyprland_focus_grab` -> for grabbing input focus, primarily for complex context menus.
- `hyprland_ctm_control` -> for managing CTMs of displays. See [hyprsunset](https://github.com/hyprwm/hyprsunset)
- `hyprland_surface` -> for setting hyprland specific wl_surface properties.
- `hyprland_lock_notify` -> for notifying a client about the screen being locked and unlocked.
- `hyprland_toplevel_mapping` -> for mapping toplevels to hyprland IDs.
- `hyprland_input_capture` -> for EIS input capture.
## Building
```sh
git clone https://github.com/hyprwm/hyprland-protocols && cd hyprland-protocols
cmake -S . -B ./build
cmake --build ./build
```
## Contributing
# Contributing
Adding new protocols is *discouraged*, as most things you think of can already be done one way or another.
However, if the protocol has a good reason to be, and you have an impl ready, feel free to make a PR.
We're always up for a discussion to improve things!
@ -25,4 +38,3 @@ We're always up for a discussion to improve things!
Fixing typos / adding explanations to existing protocols - welcome.
Adding functionality to protocols / new revisions - welcome, if accompanied with a reason and an impl.

View file

@ -1 +1 @@
0.6.1
0.7.0

View file

@ -1,64 +0,0 @@
project('hyprland-protocols',
version: run_command('cat', 'VERSION', check: true).stdout().strip(),
meson_version: '>= 0.60.3',
)
hyprland_protocols_version = meson.project_version()
fs = import('fs')
protocols = {
'hyprland-toplevel-export': ['v1'],
'hyprland-global-shortcuts': ['v1'],
'hyprland-focus-grab': ['v1'],
'hyprland-ctm-control': ['v1'],
'hyprland-surface': ['v1'],
'hyprland-lock-notify': ['v1'],
}
protocol_files = []
foreach name : protocols.keys()
foreach version : protocols.get(name)
protocol_files += [
'protocols/@0@-@1@.xml'.format(name, version)
]
endforeach
endforeach
foreach protocol_file : protocol_files
protocol_install_dir = fs.parent(join_paths(
get_option('datadir'),
'hyprland-protocols',
protocol_file,
))
install_data(
protocol_file,
install_dir: protocol_install_dir,
)
endforeach
hyprland_protocols_srcdir = meson.current_source_dir()
pkgconfig_configuration = configuration_data()
pkgconfig_configuration.set('prefix', get_option('prefix'))
pkgconfig_configuration.set('datarootdir', '${prefix}/@0@'.format(get_option('datadir')))
pkgconfig_configuration.set('abs_top_srcdir', hyprland_protocols_srcdir)
pkgconfig_configuration.set('PACKAGE', 'hyprland-protocols')
pkgconfig_configuration.set('HYPRLAND_PROTOCOLS_VERSION', hyprland_protocols_version)
pkg_install_dir = join_paths(get_option('datadir'), 'pkgconfig')
configure_file(
input: 'hyprland-protocols.pc.in',
output: 'hyprland-protocols.pc',
configuration: pkgconfig_configuration,
install_dir: pkg_install_dir,
)
hyprland_protocols = declare_dependency(
variables: {
'pkgdatadir': hyprland_protocols_srcdir,
},
)
meson.override_dependency('hyprland-protocols', hyprland_protocols)

View file

@ -1,8 +1,7 @@
{
lib,
stdenv,
meson,
ninja,
cmake,
version,
}:
stdenv.mkDerivation {
@ -11,7 +10,7 @@ stdenv.mkDerivation {
src = ../.;
nativeBuildInputs = [meson ninja];
nativeBuildInputs = [cmake];
meta = {
homepage = "https://github.com/hyprwm/hyprland-protocols";

View file

@ -36,7 +36,7 @@
This protocol is privileged and should not be exposed to unprivileged clients.
</description>
<interface name="hyprland_ctm_control_manager_v1" version="1">
<interface name="hyprland_ctm_control_manager_v1" version="2">
<description summary="manager to control CTMs">
This object is a manager which offers requests to control CTMs.
@ -91,5 +91,16 @@
<entry name="invalid_matrix" value="0"
summary="the matrix values are invalid."/>
</enum>
<event name="blocked" version="2">
<description>
This event is sent if another manager was bound by any client
at the time the current manager was bound.
Any set_ctm_for_output requests from a blocked manager will be
silently ignored by the compositor.
The client should destroy the manager after receiving this event.
</description>
</event>
</interface>
</protocol>

View file

@ -0,0 +1,155 @@
<?xml version="1.0" encoding="UTF-8"?>
<protocol name="hyprland_input_capture_v1">
<copyright>
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.
</copyright>
<description summary="Bridge input capture to the compositor">
This protocol is a bridge of the XDG input capture to the compositor.
</description>
<interface name="hyprland_input_capture_manager_v1" version="1">
<description summary="manage input capture sessions">
This interface allows to create an input capture session.
</description>
<request name="create_session">
<description summary="create a input capture session">
Create a input capture session.
</description>
<arg name="session" type="new_id" interface="hyprland_input_capture_v1"/>
<arg name="handle" type="string"/>
</request>
</interface>
<interface name="hyprland_input_capture_v1" version="1">
<description summary="close reproduction of the xdg input capture portal">
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.
</description>
<request name="clear_barriers">
<description summary="clear every barriers registered">
Remove every barriers from the session, new barriers need to be send before calling enable again.
</description>
</request>
<request name="add_barrier">
<description summary="add one barrier">
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.
</description>
<arg name="zone_set" type="uint" summary="The current zone_set" />
<arg name="id" type="uint" summary="The zone id" />
<arg name="x1" type="uint"/>
<arg name="y1" type="uint"/>
<arg name="x2" type="uint"/>
<arg name="y2" type="uint"/>
</request>
<request name="enable">
<description summary="enable input capturing">
Enable the input capturing to be triggered by the cursor crossing a barrier.
</description>
</request>
<request name="disable">
<description summary="disable input capturing">
Disable input capturing, the crossing of a barrier will not trigger anymore input capture.
</description>
</request>
<request name="release">
<description summary="release input capturing">
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.
</description>
<arg name="activation_id" type="uint" summary="The activation id provided when activated is called" />
<arg name="x"
type="fixed"
summary="the x position of the cursor" />
<arg name="y" type="fixed"
summary="the y position of the cursor" />
</request>
<event name="eis_fd">
<description summary="eis file descriptor">
This event provide the file descriptor of an eis socket where inputs will be sent when input capturing is active
</description>
<arg name="fd" type="fd" summary="eis socket file descriptor" />
</event>
<event name="disabled">
<description summary="disable the session">
Called when the application will not receive captured input. The application can call enable to request future input capturing
</description>
</event>
<event name="activated">
<description summary="inputs has been captured">
Called when the application is about to receive inputs
</description>
<arg name="activation_id"
type="uint"
summary="Same number used in eis start_emulating to allow synchronisation" />
<arg name="x"
type="fixed"
summary="the x position of the cursor" />
<arg name="y" type="fixed"
summary="the y position of the cursor" />
<arg name="barrier_id"
type="uint"
summary="the is of the barrier that have been triggered" />
</event>
<event name="deactivated">
<description summary="pointer motion">
Called when input capture is stopped, and inputs are no longer sent to the application
</description>
<arg name="activation_id"
type="uint"
summary="same activation id of the latest activated event" />
</event>
<enum name="error">
<entry name="invalid_barrier_id" value="0"
summary="The barrier id already exist"/>
<entry name="invalid_barrier" value="1"
summary="The barrier coordinates are invalid"/>
<entry name="invalid_activation_id" value="2"
summary="The activation id provided is invalid"/>
</enum>
</interface>
</protocol>

View file

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<protocol name="hyprland_toplevel_mapping_v1">
<copyright>
Copyright © 2025 WhySoBad
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.
</copyright>
<description summary="mapping of toplevels to windows">
This protocol allows clients to retrieve the mapping of toplevels to hyprland window addresses.
</description>
<interface name="hyprland_toplevel_mapping_manager_v1" version="1">
<description summary="manager to request toplevel mappings">
This object is a manager which offers requests to retrieve a window address
for a toplevel.
</description>
<request name="get_window_for_toplevel">
<description summary="get window address for toplevel">
Get the window address for a toplevel.
</description>
<arg
name="handle"
type="new_id"
interface="hyprland_toplevel_window_mapping_handle_v1"
/>
<arg
name="toplevel"
type="object"
interface="ext_foreign_toplevel_handle_v1"
summary="toplevel to get the window address for"
/>
</request>
<request name="get_window_for_toplevel_wlr">
<description summary="get window address for wlr toplevel">
Get the window address for a wlr toplevel.
</description>
<arg
name="handle"
type="new_id"
interface="hyprland_toplevel_window_mapping_handle_v1"
/>
<arg
name="toplevel"
type="object"
interface="zwlr_foreign_toplevel_handle_v1"
summary="wlr toplevel to get the window address for"
/>
</request>
<request name="destroy" type="destructor">
<description summary="destroy the manager">
All objects created by the manager will still remain valid, until their appropriate destroy
request has been called.
</description>
</request>
</interface>
<interface name="hyprland_toplevel_window_mapping_handle_v1" version="1">
<description summary="toplevel to window mapping">
This object represents a mapping of a (wlr) toplevel to a window address.
Once created, the `window_address` event will be sent containing the address of the window
associated with the toplevel.
Should the mapping fail, the `failed` event will be sent.
</description>
<event name="window_address">
<description summary="address of the window">
The full 64bit window address. The `address` field contains the lower 32 bits whilst the
`address_hi` contains the upper 32 bits
</description>
<arg
name="address_hi"
type="uint"
summary="upper 32 bits of the window address"
/>
<arg
name="address"
type="uint"
summary="lower 32 bits of the window address"
/>
</event>
<event name="failed">
<description summary="mapping failed">
The mapping of the toplevel to a window address failed. Most likely the window does not
exist (anymore).
</description>
</event>
<request name="destroy" type="destructor">
<description summary="destroy handle">
Destroy the handle. This request can be sent at any time by the client.
</description>
</request>
</interface>
</protocol>