mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
session-lock: fix buffer check
If the first commit has no buffer, the unmap hook won't catch it. Check in the commit hook instead.
This commit is contained in:
parent
e75407fd4d
commit
8c0eeb6a86
1 changed files with 7 additions and 11 deletions
|
@ -134,6 +134,13 @@ static void lock_surface_role_commit(struct wlr_surface *surface) {
|
||||||
wlr_session_lock_surface_v1_try_from_wlr_surface(surface);
|
wlr_session_lock_surface_v1_try_from_wlr_surface(surface);
|
||||||
assert(lock_surface != NULL);
|
assert(lock_surface != NULL);
|
||||||
|
|
||||||
|
if (!wlr_surface_has_buffer(surface)) {
|
||||||
|
wl_resource_post_error(lock_surface->resource,
|
||||||
|
EXT_SESSION_LOCK_SURFACE_V1_ERROR_NULL_BUFFER,
|
||||||
|
"session lock surface is committed with a null buffer");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!lock_surface->configured) {
|
if (!lock_surface->configured) {
|
||||||
wl_resource_post_error(lock_surface->resource,
|
wl_resource_post_error(lock_surface->resource,
|
||||||
EXT_SESSION_LOCK_SURFACE_V1_ERROR_COMMIT_BEFORE_FIRST_ACK,
|
EXT_SESSION_LOCK_SURFACE_V1_ERROR_COMMIT_BEFORE_FIRST_ACK,
|
||||||
|
@ -155,16 +162,6 @@ static void lock_surface_role_commit(struct wlr_surface *surface) {
|
||||||
wlr_surface_map(surface);
|
wlr_surface_map(surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lock_surface_role_unmap(struct wlr_surface *surface) {
|
|
||||||
struct wlr_session_lock_surface_v1 *lock_surface =
|
|
||||||
wlr_session_lock_surface_v1_try_from_wlr_surface(surface);
|
|
||||||
assert(lock_surface != NULL);
|
|
||||||
|
|
||||||
wl_resource_post_error(lock_surface->resource,
|
|
||||||
EXT_SESSION_LOCK_SURFACE_V1_ERROR_NULL_BUFFER,
|
|
||||||
"session lock surfaces committed with null buffer");
|
|
||||||
}
|
|
||||||
|
|
||||||
static void lock_surface_role_destroy(struct wlr_surface *surface) {
|
static void lock_surface_role_destroy(struct wlr_surface *surface) {
|
||||||
struct wlr_session_lock_surface_v1 *lock_surface =
|
struct wlr_session_lock_surface_v1 *lock_surface =
|
||||||
wlr_session_lock_surface_v1_try_from_wlr_surface(surface);
|
wlr_session_lock_surface_v1_try_from_wlr_surface(surface);
|
||||||
|
@ -191,7 +188,6 @@ static void lock_surface_role_destroy(struct wlr_surface *surface) {
|
||||||
static const struct wlr_surface_role lock_surface_role = {
|
static const struct wlr_surface_role lock_surface_role = {
|
||||||
.name = "ext_session_lock_surface_v1",
|
.name = "ext_session_lock_surface_v1",
|
||||||
.commit = lock_surface_role_commit,
|
.commit = lock_surface_role_commit,
|
||||||
.unmap = lock_surface_role_unmap,
|
|
||||||
.destroy = lock_surface_role_destroy,
|
.destroy = lock_surface_role_destroy,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue