diff options
author | Kirill Primak <vyivel@eclair.cafe> | 2023-03-04 22:59:03 +0300 |
---|---|---|
committer | Isaac Freund <mail@isaacfreund.com> | 2023-06-02 17:26:18 +0000 |
commit | 229abfae0c1ae69a5b5db96657c7dd8f76fbef03 (patch) | |
tree | b1138d07ba872bf438bd2a10ea74a33a034734c0 | |
parent | c63f3659c54f70398100fcec13fd5f69d408689e (diff) |
session-lock: use unified map logic
-rw-r--r-- | include/wlr/types/wlr_session_lock_v1.h | 2 | ||||
-rw-r--r-- | types/wlr_session_lock_v1.c | 19 |
2 files changed, 7 insertions, 14 deletions
diff --git a/include/wlr/types/wlr_session_lock_v1.h b/include/wlr/types/wlr_session_lock_v1.h index aff37871..f408f4f2 100644 --- a/include/wlr/types/wlr_session_lock_v1.h +++ b/include/wlr/types/wlr_session_lock_v1.h @@ -65,7 +65,7 @@ struct wlr_session_lock_surface_v1 { struct wlr_output *output; struct wlr_surface *surface; - bool configured, mapped; + bool configured; struct wl_list configure_list; // wlr_session_lock_surface_v1_configure.link diff --git a/types/wlr_session_lock_v1.c b/types/wlr_session_lock_v1.c index c24e05ce..02a9a729 100644 --- a/types/wlr_session_lock_v1.c +++ b/types/wlr_session_lock_v1.c @@ -152,24 +152,17 @@ static void lock_surface_role_commit(struct wlr_surface *surface) { lock_surface->current = lock_surface->pending; - if (!lock_surface->mapped) { - lock_surface->mapped = true; - wl_signal_emit_mutable(&lock_surface->events.map, NULL); - } + wlr_surface_map(surface); } -static void lock_surface_role_precommit(struct wlr_surface *surface, - const struct wlr_surface_state *state) { +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); - if (state->committed & WLR_SURFACE_STATE_BUFFER && state->buffer == NULL) { - wl_resource_post_error(lock_surface->resource, - EXT_SESSION_LOCK_SURFACE_V1_ERROR_NULL_BUFFER, - "session lock surfaces committed with null buffer"); - return; - } + 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) { @@ -199,7 +192,7 @@ static void lock_surface_role_destroy(struct wlr_surface *surface) { static const struct wlr_surface_role lock_surface_role = { .name = "ext_session_lock_surface_v1", .commit = lock_surface_role_commit, - .precommit = lock_surface_role_precommit, + .unmap = lock_surface_role_unmap, .destroy = lock_surface_role_destroy, }; |