将指针重新定位到表面上的某个位置

此全局接口允许应用程序请求将指针移动到相对于 wl_surface 的位置。

请注意,如果所需行为是将指针限制在某个区域或锁定在某个位置,则此协议无法提供可靠的方法来实现。在这些用例中,应改用指针约束(pointer constraint)和指针锁定(pointer lock)协议。

警告!此文件中描述的协议当前处于测试阶段。向后兼容的更改可能会与相应的接口版本升级一起添加。向后不兼容的更改只能通过创建扩展的新主要版本来完成。

destroy
类型: destructor
destroy()
销毁 warp manager

销毁 pointer warp manager。

warp_pointer(surface: object<wl_surface>, pointer: object<wl_pointer>, x: fixed, y: fixed, serial: uint)
参数
类型
描述
surfaceobject<wl_surface>
surface to position the pointer on
pointerobject<wl_pointer>
the pointer that should be repositioned
xfixed
yfixed
serialuint
serial number of the enter event
重新定位表面上的指针

请求 compositor 将指针移动到表面局部位置。 compositor 是否接受该请求由具体实现决定,但它应该:

  • 如果表面具有指针焦点,则接受该请求,包括它具有隐式指针抓取的情况
  • 如果 enter serial 不正确,则拒绝该请求
  • 如果请求的位置在表面外部,则拒绝该请求

请注意,enter serial 对于客户端的任何表面都是有效的,并且不必来自指针被 warp 到的表面。


合成器支持

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
wp_pointer_warp_v1
x
x
x
1
1
1
x
x
x
x
1
x
x
x
x
x
x
x

Copyright © 2024 Neal Gompa Copyright © 2024 Xaver Hugl Copyright © 2024 Matthias Klumpp Copyright © 2024 Vlad Zahorodnii

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Footer

© 2026 Wayland Explorer

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

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