mirror of
https://github.com/swaywm/sway.git
synced 2024-11-14 06:24:20 +01:00
sway/lock: handle mode in output commit handler
This commit is contained in:
parent
aa03a8fcb5
commit
6b3245ac77
10
sway/lock.c
10
sway/lock.c
@ -13,7 +13,6 @@ struct sway_session_lock_surface {
|
|||||||
struct wl_listener map;
|
struct wl_listener map;
|
||||||
struct wl_listener destroy;
|
struct wl_listener destroy;
|
||||||
struct wl_listener surface_commit;
|
struct wl_listener surface_commit;
|
||||||
struct wl_listener output_mode;
|
|
||||||
struct wl_listener output_commit;
|
struct wl_listener output_commit;
|
||||||
struct wl_listener output_destroy;
|
struct wl_listener output_destroy;
|
||||||
};
|
};
|
||||||
@ -40,12 +39,6 @@ static void handle_surface_commit(struct wl_listener *listener, void *data) {
|
|||||||
output_damage_surface(surf->output, 0, 0, surf->surface, false);
|
output_damage_surface(surf->output, 0, 0, surf->surface, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handle_output_mode(struct wl_listener *listener, void *data) {
|
|
||||||
struct sway_session_lock_surface *surf = wl_container_of(listener, surf, output_mode);
|
|
||||||
wlr_session_lock_surface_v1_configure(surf->lock_surface,
|
|
||||||
surf->output->width, surf->output->height);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void handle_output_commit(struct wl_listener *listener, void *data) {
|
static void handle_output_commit(struct wl_listener *listener, void *data) {
|
||||||
struct wlr_output_event_commit *event = data;
|
struct wlr_output_event_commit *event = data;
|
||||||
struct sway_session_lock_surface *surf = wl_container_of(listener, surf, output_commit);
|
struct sway_session_lock_surface *surf = wl_container_of(listener, surf, output_commit);
|
||||||
@ -76,7 +69,6 @@ static void destroy_lock_surface(struct sway_session_lock_surface *surf) {
|
|||||||
wl_list_remove(&surf->map.link);
|
wl_list_remove(&surf->map.link);
|
||||||
wl_list_remove(&surf->destroy.link);
|
wl_list_remove(&surf->destroy.link);
|
||||||
wl_list_remove(&surf->surface_commit.link);
|
wl_list_remove(&surf->surface_commit.link);
|
||||||
wl_list_remove(&surf->output_mode.link);
|
|
||||||
wl_list_remove(&surf->output_commit.link);
|
wl_list_remove(&surf->output_commit.link);
|
||||||
wl_list_remove(&surf->output_destroy.link);
|
wl_list_remove(&surf->output_destroy.link);
|
||||||
output_damage_whole(surf->output);
|
output_damage_whole(surf->output);
|
||||||
@ -115,8 +107,6 @@ static void handle_new_surface(struct wl_listener *listener, void *data) {
|
|||||||
wl_signal_add(&lock_surface->events.destroy, &surf->destroy);
|
wl_signal_add(&lock_surface->events.destroy, &surf->destroy);
|
||||||
surf->surface_commit.notify = handle_surface_commit;
|
surf->surface_commit.notify = handle_surface_commit;
|
||||||
wl_signal_add(&surf->surface->events.commit, &surf->surface_commit);
|
wl_signal_add(&surf->surface->events.commit, &surf->surface_commit);
|
||||||
surf->output_mode.notify = handle_output_mode;
|
|
||||||
wl_signal_add(&output->wlr_output->events.mode, &surf->output_mode);
|
|
||||||
surf->output_commit.notify = handle_output_commit;
|
surf->output_commit.notify = handle_output_commit;
|
||||||
wl_signal_add(&output->wlr_output->events.commit, &surf->output_commit);
|
wl_signal_add(&output->wlr_output->events.commit, &surf->output_commit);
|
||||||
surf->output_destroy.notify = handle_output_destroy;
|
surf->output_destroy.notify = handle_output_destroy;
|
||||||
|
Loading…
Reference in New Issue
Block a user