Hyprland focus grab

将输入焦点限制在一组 surface 上

此协议允许客户端将输入焦点限制在一组特定的 surface 上,并在限制器被移除时接收通知。

焦点抓取对象的管理器

此接口允许客户端创建 surface 抓取对象。

create_grab(grab: new_id<hyprland_focus_grab_v1>)
参数
类型
描述
grabnew_id<hyprland_focus_grab_v1>
创建焦点抓取对象

创建一个 surface 抓取对象。

destroy()
销毁焦点抓取管理器

销毁焦点抓取管理器。 这不会销毁已存在的焦点抓取对象。


输入焦点限制器

此接口将输入焦点限制在指定的 surface 白名单中,只要焦点抓取对象存在且至少有一个已提交的 surface。

白名单内 surface 的鼠标和触摸事件将正常传递给该 surface,而白名单外的事件将清除抓取对象。键盘事件将传递给客户端,如果白名单中的 surface 尚未获得焦点,合成器选择的白名单中的 surface 将接收 wl_keyboard::enter 事件。

当满足实现定义的条件(通常意味着在所有白名单 surface 之外发生鼠标或触摸输入)时,合成器将清除白名单,使抓取失效并发送 cleared 事件。如果合成器酌情启动了另一个焦点抓取或类似操作,也会发生同样的情况。

add_surface(surface: object<wl_surface>)
参数
类型
描述
surfaceobject<wl_surface>
将 surface 添加到焦点白名单

将 surface 添加到白名单。销毁 surface 等同于显式调用 remove_surface,重复添加将被忽略。

在调用 commit 之前不会生效。

remove_surface(surface: object<wl_surface>)
参数
类型
描述
surfaceobject<wl_surface>
从焦点白名单中移除 surface

从白名单中移除 surface。销毁 surface 等同于显式调用此函数。

如果抓取处于活动状态且被移除的 surface 已获得键盘焦点,另一个 surface 将在提交时获得焦点。

在调用 commit 之前不会生效。

commit()
提交焦点白名单

提交对 surface 白名单的待处理更改。

如果列表之前没有条目现在至少有一个,抓取将启动。如果之前有条目现在没有,抓取将变为失效状态。

destroy()
销毁焦点抓取

销毁抓取对象并在抓取处于活动状态时移除抓取。

cleared()
焦点抓取已被清除

当活动的抓取被合成器取消时发送,无论原因为何。


合成器支持

Cage
Cage
0.2.0
COSMIC
COSMIC
1.0.0~beta.8
GameScope
GameScope
3.15.14
Hyprland
Hyprland
0.52.1
Jay
1.12.0
KWin
KWin
6.6
Labwc
Labwc
0.9.2
Louvre
Louvre
2.14.1
Mir
Mir
2.26
Muffin
Muffin
6.6.0
Mutter
Mutter
49.2
niri
niri
25.11
phoc
phoc
0.52
river
river
0.3.13
Sway
Sway
1.11
Treeland
Treeland
0.8.0
Wayfire
Wayfire
0.9.0
Weston
Weston
14.0.2
hyprland_focus_grab_manager_v1
x
x
x
1
x
x
x
x
x
x
x
x
x
x
x
x
x
x

Copyright © 2024 outfoxxed 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.

Footer

© 2026 Wayland Explorer

本网站与 Wayland 官方项目无任何关联。网站所有内容均根据 Wayland 协议 XML 文件自动生成。

本网站使用的 Visual Studio Code - Codicons 遵循 CC BY 4.0 许可。