diff options
author | Alexander Preisinger <alexander.preisinger@gmail.com> | 2014-01-28 13:15:36 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-01-31 19:07:31 +0100 |
commit | ebe04ab69230ce36495a0cef0830a503de7f2067 (patch) | |
tree | 78c86396fcf28b2f804b6d16a629288ef4cc101b /video/out/vo_wayland.c | |
parent | 808aa08cc0b68ec2640f7b3be6759c803f5cdb34 (diff) | |
download | mpv-ebe04ab69230ce36495a0cef0830a503de7f2067.tar.bz2 mpv-ebe04ab69230ce36495a0cef0830a503de7f2067.tar.xz |
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 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) |