Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lock: fix swaylock cursor remaining visible #8343

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions sway/lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct sway_session_lock_output {

// invalid if surface is NULL
struct wl_listener surface_destroy;
struct wl_listener surface_map;
struct wl_listener surface_commit;
};

static void focus_surface(struct sway_session_lock *lock,
Expand Down Expand Up @@ -59,8 +59,8 @@ static void refocus_output(struct sway_session_lock_output *output) {
}
}

static void handle_surface_map(struct wl_listener *listener, void *data) {
struct sway_session_lock_output *surf = wl_container_of(listener, surf, surface_map);
static void handle_surface_commit(struct wl_listener *listener, void *data) {
struct sway_session_lock_output *surf = wl_container_of(listener, surf, surface_commit);
if (surf->lock->focused == NULL) {
focus_surface(surf->lock, surf->surface->surface);
}
Expand All @@ -75,7 +75,7 @@ static void handle_surface_destroy(struct wl_listener *listener, void *data) {
sway_assert(output->surface, "Trying to destroy a surface that the lock doesn't think exists");
output->surface = NULL;
wl_list_remove(&output->surface_destroy.link);
wl_list_remove(&output->surface_map.link);
wl_list_remove(&output->surface_commit.link);
}

static void lock_output_reconfigure(struct sway_session_lock_output *output) {
Expand Down Expand Up @@ -112,8 +112,8 @@ static void handle_new_surface(struct wl_listener *listener, void *data) {

lock_output->surface_destroy.notify = handle_surface_destroy;
wl_signal_add(&lock_surface->events.destroy, &lock_output->surface_destroy);
lock_output->surface_map.notify = handle_surface_map;
wl_signal_add(&lock_surface->surface->events.map, &lock_output->surface_map);
lock_output->surface_commit.notify = handle_surface_commit;
wl_signal_add(&lock_surface->surface->events.commit, &lock_output->surface_commit);

lock_output_reconfigure(lock_output);
}
Expand All @@ -122,7 +122,7 @@ static void sway_session_lock_output_destroy(struct sway_session_lock_output *ou
if (output->surface) {
refocus_output(output);
wl_list_remove(&output->surface_destroy.link);
wl_list_remove(&output->surface_map.link);
wl_list_remove(&output->surface_commit.link);
}

wl_list_remove(&output->commit.link);
Expand Down