Pointer warp
此全局接口允许应用程序请求将指针移动到相对于 wl_surface 的位置。
请注意,如果所需行为是将指针限制在某个区域或锁定在某个位置,则此协议无法提供可靠的方法来实现。在这些用例中,应改用指针约束(pointer constraint)和指针锁定(pointer lock)协议。
警告!此文件中描述的协议当前处于测试阶段。向后兼容的更改可能会与相应的接口版本升级一起添加。向后不兼容的更改只能通过创建扩展的新主要版本来完成。
warp_pointer(surface: object<wl_surface>, pointer: object<wl_pointer>, x: fixed, y: fixed, serial: uint)
参数 | 类型 | 描述 |
|---|---|---|
| surface | object<wl_surface> | surface to position the pointer on |
| pointer | object<wl_pointer> | the pointer that should be repositioned |
| x | fixed | |
| y | fixed | |
| serial | uint | serial number of the enter event |
请求 compositor 将指针移动到表面局部位置。 compositor 是否接受该请求由具体实现决定,但它应该:
- 如果表面具有指针焦点,则接受该请求,包括它具有隐式指针抓取的情况
- 如果 enter serial 不正确,则拒绝该请求
- 如果请求的位置在表面外部,则拒绝该请求
请注意,enter serial 对于客户端的任何表面都是有效的,并且不必来自指针被 warp 到的表面。
合成器支持
Cage | COSMIC | GameScope | Hyprland | Jay | KWin | Labwc | Louvre | Mir | Muffin | Mutter | niri | phoc | river | Sway | Treeland | Wayfire | Weston | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| wp_pointer_warp_v1 | x | x | x | 1 | 1 | 1 | x | x | x | x | 1 | x | x | x | x | x | x | x |
Copyright
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.