此接口允许抑制空闲行为,例如屏幕熄灭、锁定和屏保。客户端全局绑定空闲管理器,然后为每个 surface 创建空闲抑制器对象。
警告!此文件中描述的实验性协议可能会进行不兼容的更改。向后兼容的更改可能会与相应的接口版本号提升一起添加。向后不兼容的更改通过提升协议和接口名称中的版本号并重置接口版本来完成。一旦协议被宣布为稳定版本,协议和接口名称中的 'z' 前缀和版本号将被移除,接口版本号将被重置。
create_inhibitor(id: new_id<zwp_idle_inhibitor_v1>, surface: object<wl_surface>)
参数 | 类型 | 描述 |
|---|---|---|
| id | new_id<zwp_idle_inhibitor_v1> | |
| surface | object<wl_surface> | the surface that inhibits the idle behavior |
创建与给定 surface 关联的新抑制器对象。
空闲抑制器防止关联 surface 所在的输出被设置为由于缺乏用户交互而在视觉上不可用的状态(例如熄灭、变暗、锁定、设置为省电模式等)。任何屏保进程也会被阻止显示。
如果 surface 被销毁、取消映射、被遮挡、失去可见性或在视觉上与用户不再相关,compositor 将不会遵守空闲抑制器;如果 surface 随后重新获得可见性,抑制器将再次生效。同样,如果在建立抑制器时系统已经处于空闲状态,抑制器也不会被遵守,但如果系统后来解除空闲并重新进入空闲状态,抑制器将生效。
合成器支持
Cage | COSMIC | GameScope | Hyprland | Jay | KWin | Labwc | Louvre | Mir | Muffin | Mutter | niri | phoc | river | Sway | Treeland | Wayfire | Weston | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| zwp_idle_inhibit_manager_v1 | 1 | 1 | x | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | x |
Copyright
Copyright © 2015 Samsung Electronics Co., Ltd
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.