wlr output power management
此协议允许客户端控制当前 compositor 空间中输出的电源管理模式。其目的是允许特殊客户端(如桌面 shell)在系统空闲时关闭输出。
要修改当前不在 compositor 空间中的输出,请参阅 wlr-output-management。
警告!此文件中描述的协议是实验性的,可能会进行不兼容的更改。兼容的更改可以与相应的接口版本递增一起添加。 不兼容的更改通过递增协议和接口名称中的版本号并重置接口版本来完成。 一旦协议宣布为稳定,协议和接口名称中的 'z' 前缀和版本号将被移除,接口版本号将被重置。
此接口是一个管理器,允许创建每输出的电源管理模式控制。
get_output_power(id: new_id<zwlr_output_power_v1>, output: object<wl_output>)
参数 | 类型 | 描述 |
|---|---|---|
| id | new_id<zwlr_output_power_v1> | |
| output | object<wl_output> |
创建一个输出电源管理模式控制,可用于调整给定输出的电源管理模式。
此对象提供设置输出电源管理模式的请求。
set_mode(mode: uint<zwlr_output_power_v1.mode>)
参数 | 类型 | 描述 |
|---|---|---|
| mode | uint<zwlr_output_power_v1.mode> | the power save mode to set |
将输出的省电模式设置为给定模式。模式更改立即生效。如果输出不支持给定模式,将发送 failed 事件。
mode(mode: uint<zwlr_output_power_v1.mode>)
参数 | 类型 | 描述 |
|---|---|---|
| mode | uint<zwlr_output_power_v1.mode> | the output's new power management mode |
报告输出的电源管理模式变更。
mode 事件在输出更改其电源管理模式后发送。原因可能是客户端使用了 set_mode,或 compositor 决定更改输出的模式。 此事件也会在对象创建时立即发送,以便客户端了解当前的电源管理模式。
failed()
此事件表示输出电源管理模式控制不再有效。这可能由多种原因导致,包括:
- 输出不支持电源管理
- 另一个客户端已经拥有该输出的独占电源管理模式控制
- 输出消失
收到此事件后,客户端应销毁此对象。
合成器支持
Cage | COSMIC | GameScope | Hyprland | Jay | KWin | Labwc | Louvre | Mir | Muffin | Mutter | niri | phoc | river | Sway | Treeland | Wayfire | Weston | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| zwlr_output_power_manager_v1 | x | 1 | x | 1 | x | x | 1 | x | x | x | x | x | 1 | 1 | 1 | 1 | 1 | x |
Copyright
Copyright © 2019 Purism SPC
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.