From ebe04ab69230ce36495a0cef0830a503de7f2067 Mon Sep 17 00:00:00 2001 From: Alexander Preisinger Date: Tue, 28 Jan 2014 13:15:36 +0100 Subject: wayland/shm: remove resize boilerplate The problem seems to have solved itself. I guess the previous changes to resizing and commit ba101ab made this possible. Consider me happy for removing that crap. --- video/out/vo_wayland.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/video/out/vo_wayland.c b/video/out/vo_wayland.c index dddf047611..14823db1d6 100644 --- a/video/out/vo_wayland.c +++ b/video/out/vo_wayland.c @@ -466,27 +466,7 @@ static void frame_handle_redraw(void *data, struct buffer *buf = buffer_get_front(p); if (buf) { - if (p->resize_attach) { - wl_surface_attach(wl->window.surface, buf->wlbuf, p->x, p->y); - wl_surface_damage(wl->window.surface, 0, 0, p->dst_w, p->dst_h); - wl_surface_commit(wl->window.surface); - - if (callback) - wl_callback_destroy(callback); - - p->redraw_callback = NULL; - buffer_finalise_front(buf); - p->resize_attach = false; - - destroy_shm_buffer(&p->tmp_buffer); - - // I have to destroy the callback and return early to avoid black flickers - // I don't exactly know why this, but I guess the back buffer is still - // empty. The callback loop will be restored on the next flip_page call - return; - } - - wl_surface_attach(wl->window.surface, buf->wlbuf, 0, 0); + wl_surface_attach(wl->window.surface, buf->wlbuf, p->x, p->y); wl_surface_damage(wl->window.surface, 0, 0, p->dst_w, p->dst_h); if (callback) @@ -496,6 +476,9 @@ static void frame_handle_redraw(void *data, wl_callback_add_listener(p->redraw_callback, &frame_listener, p); wl_surface_commit(wl->window.surface); buffer_finalise_front(buf); + + // to avoid multiple resizes of non-shown frames + p->resize_attach = false; } else { if (callback) -- cgit v1.2.3