mirror of
https://github.com/swaywm/sway.git
synced 2024-12-26 15:06:34 +01:00
Merge e4e407f260
into 801bc76ce3
This commit is contained in:
commit
05406f8296
1 changed files with 7 additions and 7 deletions
14
sway/lock.c
14
sway/lock.c
|
@ -25,7 +25,7 @@ struct sway_session_lock_output {
|
||||||
|
|
||||||
// invalid if surface is NULL
|
// invalid if surface is NULL
|
||||||
struct wl_listener surface_destroy;
|
struct wl_listener surface_destroy;
|
||||||
struct wl_listener surface_map;
|
struct wl_listener surface_commit;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void focus_surface(struct sway_session_lock *lock,
|
static void focus_surface(struct sway_session_lock *lock,
|
||||||
|
@ -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) {
|
static void handle_surface_commit(struct wl_listener *listener, void *data) {
|
||||||
struct sway_session_lock_output *surf = wl_container_of(listener, surf, surface_map);
|
struct sway_session_lock_output *surf = wl_container_of(listener, surf, surface_commit);
|
||||||
if (surf->lock->focused == NULL) {
|
if (surf->lock->focused == NULL) {
|
||||||
focus_surface(surf->lock, surf->surface->surface);
|
focus_surface(surf->lock, surf->surface->surface);
|
||||||
}
|
}
|
||||||
|
@ -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");
|
sway_assert(output->surface, "Trying to destroy a surface that the lock doesn't think exists");
|
||||||
output->surface = NULL;
|
output->surface = NULL;
|
||||||
wl_list_remove(&output->surface_destroy.link);
|
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) {
|
static void lock_output_reconfigure(struct sway_session_lock_output *output) {
|
||||||
|
@ -123,8 +123,8 @@ static void handle_new_surface(struct wl_listener *listener, void *data) {
|
||||||
|
|
||||||
lock_output->surface_destroy.notify = handle_surface_destroy;
|
lock_output->surface_destroy.notify = handle_surface_destroy;
|
||||||
wl_signal_add(&lock_surface->events.destroy, &lock_output->surface_destroy);
|
wl_signal_add(&lock_surface->events.destroy, &lock_output->surface_destroy);
|
||||||
lock_output->surface_map.notify = handle_surface_map;
|
lock_output->surface_commit.notify = handle_surface_commit;
|
||||||
wl_signal_add(&lock_surface->surface->events.map, &lock_output->surface_map);
|
wl_signal_add(&lock_surface->surface->events.commit, &lock_output->surface_commit);
|
||||||
|
|
||||||
lock_output_reconfigure(lock_output);
|
lock_output_reconfigure(lock_output);
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,7 @@ static void sway_session_lock_output_destroy(struct sway_session_lock_output *ou
|
||||||
if (output->surface) {
|
if (output->surface) {
|
||||||
refocus_output(output);
|
refocus_output(output);
|
||||||
wl_list_remove(&output->surface_destroy.link);
|
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->destroy.link);
|
wl_list_remove(&output->destroy.link);
|
||||||
|
|
Loading…
Reference in a new issue