mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 21:05:58 +01:00
session-lock: use unified map logic
This commit is contained in:
parent
c63f3659c5
commit
229abfae0c
2 changed files with 7 additions and 14 deletions
|
@ -65,7 +65,7 @@ struct wlr_session_lock_surface_v1 {
|
||||||
struct wlr_output *output;
|
struct wlr_output *output;
|
||||||
struct wlr_surface *surface;
|
struct wlr_surface *surface;
|
||||||
|
|
||||||
bool configured, mapped;
|
bool configured;
|
||||||
|
|
||||||
struct wl_list configure_list; // wlr_session_lock_surface_v1_configure.link
|
struct wl_list configure_list; // wlr_session_lock_surface_v1_configure.link
|
||||||
|
|
||||||
|
|
|
@ -152,24 +152,17 @@ static void lock_surface_role_commit(struct wlr_surface *surface) {
|
||||||
|
|
||||||
lock_surface->current = lock_surface->pending;
|
lock_surface->current = lock_surface->pending;
|
||||||
|
|
||||||
if (!lock_surface->mapped) {
|
wlr_surface_map(surface);
|
||||||
lock_surface->mapped = true;
|
|
||||||
wl_signal_emit_mutable(&lock_surface->events.map, NULL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lock_surface_role_precommit(struct wlr_surface *surface,
|
static void lock_surface_role_unmap(struct wlr_surface *surface) {
|
||||||
const struct wlr_surface_state *state) {
|
|
||||||
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);
|
||||||
assert(lock_surface != NULL);
|
assert(lock_surface != NULL);
|
||||||
|
|
||||||
if (state->committed & WLR_SURFACE_STATE_BUFFER && state->buffer == NULL) {
|
wl_resource_post_error(lock_surface->resource,
|
||||||
wl_resource_post_error(lock_surface->resource,
|
EXT_SESSION_LOCK_SURFACE_V1_ERROR_NULL_BUFFER,
|
||||||
EXT_SESSION_LOCK_SURFACE_V1_ERROR_NULL_BUFFER,
|
"session lock surfaces committed with null buffer");
|
||||||
"session lock surfaces committed with null buffer");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lock_surface_role_destroy(struct wlr_surface *surface) {
|
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 = {
|
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,
|
||||||
.precommit = lock_surface_role_precommit,
|
.unmap = lock_surface_role_unmap,
|
||||||
.destroy = lock_surface_role_destroy,
|
.destroy = lock_surface_role_destroy,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue