Hyprland lock notify
此接口允许客户端监控 Wayland 会话是否处于锁定或解锁状态。
get_lock_notification(id: new_id<hyprland_lock_notification_v1>)
参数 | 类型 | 描述 |
|---|---|---|
| id | new_id<hyprland_lock_notification_v1> |
创建一个新的锁定通知对象。
如果调用此方法时会话已锁定,将立即发送 locked 事件。
此接口由 compositor 用于向客户端发送锁定通知事件。
通常,当客户端通过 ext-session-lock 锁定/解锁会话时会发出 "locked" 和 "unlocked" 事件,但 compositor 可以选择为任何其他锁定机制发送通知。
compositor 必须在会话的锁定和解锁状态之间的过渡期结束后发出通知。 在 ext-session-lock 的上下文中,这意味着 "locked" 事件预期在会话锁定客户端已在每个输出上呈现锁定屏幕帧之后发送,这对应于 ext-session-lock 的 "locked" 事件。
locked()
当 Wayland 会话被锁定时发送此事件。
如果在没有 unlock 事件介入的情况下发送此事件两次,则属于 compositor 协议错误。
unlocked()
当 Wayland 会话解锁时发送此事件。
如果在没有 locked 事件介入的情况下发送此事件两次,则属于 compositor 协议错误。在任何 locked 事件之前发送此事件也属于 compositor 协议错误。
合成器支持
Cage | COSMIC | GameScope | Hyprland | Jay | KWin | Labwc | Louvre | Mir | Muffin | Mutter | niri | phoc | river | Sway | Treeland | Wayfire | Weston | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| hyprland_lock_notifier_v1 | x | x | x | 1 | x | x | x | x | x | x | x | x | x | x | x | x | x | x |
Copyright
Copyright © 2025 Maximilian Seidler 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.