diff options
author | Alexander Preisinger <alexander.preisinger@gmail.com> | 2014-01-28 13:15:36 +0100 |
---|---|---|
committer | Alexander Preisinger <alexander.preisinger@gmail.com> | 2014-01-28 13:15:36 +0100 |
commit | 3114390c5b6c243f5f8900bad1cbc9924ccdfdde (patch) | |
tree | a083451a85bfe1175d3202110cc82cd43b3ca0d1 /video/out/vo_wayland.c | |
parent | d26ee98fa61872164aacd647ae8416626e802984 (diff) |
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.
Diffstat (limited to 'video/out/vo_wayland.c')
-rw-r--r-- | video/out/vo_wayland.c | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/video/out/vo_wayland.c b/video/out/vo_wayland.c index 8794b2ec99..ce6efa2ae5 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) |