Update to wlroots 0.6.0

This commit is contained in:
Drew DeVault 2019-04-25 11:40:25 -04:00 committed by Jente Hidskes
parent 887c855a3b
commit 9354781f32
2 changed files with 14 additions and 13 deletions

View file

@ -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:

View file

@ -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);