From b989fe50f08d77245b73790f52ea2cc730b94b4e Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 8 Apr 2021 07:39:14 +0200 Subject: [PATCH] Fix incompatibilities with wlroots 0.13.0 --- cagebreak.c | 2 +- keybinding.c | 2 +- output.c | 10 +++++----- output.h | 2 +- seat.c | 4 +++- xdg_shell.c | 3 ++- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 0e3b9bb..6e16dc2 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -308,7 +308,7 @@ main(int argc, char *argv[]) { set_sig_handler(SIGCHLD, sig_chld_handler); - backend = wlr_backend_autocreate(server.wl_display, NULL); + backend = wlr_backend_autocreate(server.wl_display); if(!backend) { wlr_log(WLR_ERROR, "Unable to create the wlroots backend"); ret = 1; diff --git a/keybinding.c b/keybinding.c index 723437a..9989d5c 100644 --- a/keybinding.c +++ b/keybinding.c @@ -614,7 +614,7 @@ keybinding_cycle_views(struct cg_server *server, bool reverse) { } struct cg_view *it_view, *next_view = NULL; if(reverse) { - next_view=view_get_prev_view(current_view); + next_view = view_get_prev_view(current_view); } else { struct wl_list *it; it = current_view->link.next; diff --git a/output.c b/output.c index 91ba032..1029d9b 100644 --- a/output.c +++ b/output.c @@ -361,8 +361,8 @@ frame_done: } static void -handle_output_transform(struct wl_listener *listener, void *data) { - struct cg_output *output = wl_container_of(listener, output, transform); +handle_output_commit(struct wl_listener *listener, void *data) { + struct cg_output *output = wl_container_of(listener, output, commit); if(!output->wlr_output->enabled || output->workspaces == NULL) { return; @@ -468,7 +468,7 @@ output_destroy(struct cg_output *output) { wl_list_remove(&output->destroy.link); wl_list_remove(&output->mode.link); - wl_list_remove(&output->transform.link); + wl_list_remove(&output->commit.link); wl_list_remove(&output->damage_frame.link); wl_list_remove(&output->damage_destroy.link); @@ -613,8 +613,8 @@ handle_new_output(struct wl_listener *listener, void *data) { output->mode.notify = handle_output_mode; wl_signal_add(&wlr_output->events.mode, &output->mode); - output->transform.notify = handle_output_transform; - wl_signal_add(&wlr_output->events.transform, &output->transform); + output->commit.notify = handle_output_commit; + wl_signal_add(&wlr_output->events.commit, &output->commit); output->destroy.notify = handle_output_destroy; wl_signal_add(&wlr_output->events.destroy, &output->destroy); output->damage_frame.notify = handle_output_damage_frame; diff --git a/output.h b/output.h index a11d4be..42cb629 100644 --- a/output.h +++ b/output.h @@ -16,7 +16,7 @@ struct cg_output { struct wlr_output_damage *damage; struct wl_listener mode; - struct wl_listener transform; + struct wl_listener commit; struct wl_listener destroy; struct wl_listener damage_frame; struct wl_listener damage_destroy; diff --git a/seat.c b/seat.c index daee188..469bf4e 100644 --- a/seat.c +++ b/seat.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #if CG_HAS_XWAYLAND @@ -333,7 +334,8 @@ handle_key_event(struct cg_keyboard_group *group, struct cg_seat *seat, bool handled = false; for(int i = 0; i < nsyms; ++i) { - if(event->state == WLR_KEY_PRESSED && !key_is_modifier(syms[i])) { + if(event->state == WL_KEYBOARD_KEY_STATE_PRESSED && + !key_is_modifier(syms[i])) { uint32_t modifiers = wlr_keyboard_get_modifiers(device->keyboard); /* Get the consumed_modifiers and remove them from the modifier list */ diff --git a/xdg_shell.c b/xdg_shell.c index 5a85982..0e76dc4 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -235,7 +235,8 @@ static void for_each_popup(struct cg_view *view, wlr_surface_iterator_func_t iterator, void *data) { struct cg_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_view(view); - wlr_xdg_surface_for_each_popup(xdg_shell_view->xdg_surface, iterator, data); + wlr_xdg_surface_for_each_popup_surface(xdg_shell_view->xdg_surface, + iterator, data); } static struct wlr_surface *