From 08ecd52a3313d00d06cc4e12d4d3243865af5dd0 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 25 Apr 2019 11:40:25 -0400 Subject: [PATCH] Update to wlroots 0.6.0 --- output.c | 15 ++++++++------- xdg_shell.c | 12 ++++++------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/output.c b/output.c index c682dcc..1849486 100644 --- a/output.c +++ b/output.c @@ -198,23 +198,23 @@ handle_output_damage_frame(struct wl_listener *listener, void *data) struct timespec now; clock_gettime(CLOCK_MONOTONIC, &now); - bool needs_swap; + bool needs_frame; pixman_region32_t damage; pixman_region32_init(&damage); - if (!wlr_output_damage_make_current(output->damage, &needs_swap, &damage)) { + if (!wlr_output_damage_attach_render(output->damage, &needs_frame, &damage)) { wlr_log(WLR_ERROR, "Cannot make damage output current"); goto damage_finish; } - if (!needs_swap) { - wlr_log(WLR_DEBUG, "Output doesn't need swap and isn't damaged"); + if (!needs_frame) { + wlr_log(WLR_DEBUG, "Output doesn't need frame and isn't damaged"); goto damage_finish; } wlr_renderer_begin(renderer, output->wlr_output->width, output->wlr_output->height); if (!pixman_region32_not_empty(&damage)) { - wlr_log(WLR_DEBUG, "Output isn't damaged but needs a buffer swap"); + wlr_log(WLR_DEBUG, "Output isn't damaged but needs a buffer frame"); goto renderer_end; } @@ -267,8 +267,9 @@ handle_output_damage_frame(struct wl_listener *listener, void *data) enum wl_output_transform transform = wlr_output_transform_invert(output->wlr_output->transform); wlr_region_transform(&damage, &damage, transform, output_width, output_height); - if (!wlr_output_damage_swap_buffers(output->damage, &now, &damage)) { - wlr_log(WLR_ERROR, "Could not swap buffers"); + wlr_output_set_damage(output->wlr_output, &damage); + if (!wlr_output_commit(output->wlr_output)) { + wlr_log(WLR_ERROR, "Could not commit output"); } damage_finish: diff --git a/xdg_shell.c b/xdg_shell.c index 4fcb00e..f964f76 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -94,15 +94,15 @@ popup_unconstrain(struct cg_xdg_popup *popup) { struct cg_view *view = popup->view_child.view; struct wlr_output *output = view->server->output->wlr_output; + struct wlr_output_layout *output_layout = view->server->output_layout; - int width, height; - wlr_output_effective_resolution(output, &width, &height); + struct wlr_box *output_box = wlr_output_layout_get_box(output_layout, output); struct wlr_box output_toplevel_box = { - .x = output->lx - view->x, - .y = output->ly - view->y, - .width = width, - .height = height + .x = output_box->x - view->x, + .y = output_box->y - view->y, + .width = output_box->width, + .height = output_box->height }; wlr_xdg_popup_unconstrain_from_box(popup->wlr_popup, &output_toplevel_box);