summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2016-07-30 11:53:44 +0100
committerwm4 <wm4@nowhere>2016-07-30 15:33:00 +0200
commit45687c17f79eb1bff58e48cd2bca71f42556ed20 (patch)
tree334da17c61e5a684ba9133e036e57439cc15f47f
parent2f986a598039b23862eaa870076c0c8fc2e9f86a (diff)
downloadmpv-45687c17f79eb1bff58e48cd2bca71f42556ed20.tar.bz2
mpv-45687c17f79eb1bff58e48cd2bca71f42556ed20.tar.xz
wayland_common: fix fullscreen image switching bug
The problem was that when in fullscreen, switching between images did not issue a resize event, causing none of the images to be rendered correctly. This fixes the problem by issuing a resize event with the screen width and height. This commit also moves the zeroing of the events field to when it gets retrieved by mpv rather than randomly after a resize in the vo/backend code.
-rw-r--r--video/out/opengl/context_wayland.c2
-rw-r--r--video/out/vo_wayland.c1
-rw-r--r--video/out/wayland_common.c7
3 files changed, 4 insertions, 6 deletions
diff --git a/video/out/opengl/context_wayland.c b/video/out/opengl/context_wayland.c
index b1d9a32bca..efb6128b92 100644
--- a/video/out/opengl/context_wayland.c
+++ b/video/out/opengl/context_wayland.c
@@ -59,9 +59,7 @@ static void egl_resize(struct vo_wayland_state *wl)
/* set size for mplayer */
wl->vo->dwidth = scale*wl->window.width;
wl->vo->dheight = scale*wl->window.height;
-
wl->vo->want_redraw = true;
- wl->window.events = 0;
}
static int egl_create_context(struct vo_wayland_state *wl,
diff --git a/video/out/vo_wayland.c b/video/out/vo_wayland.c
index 236421e4ef..7761223111 100644
--- a/video/out/vo_wayland.c
+++ b/video/out/vo_wayland.c
@@ -314,7 +314,6 @@ static bool resize(struct priv *p)
p->x = x;
p->y = y;
- p->wl->window.events = 0;
p->vo->want_redraw = true;
return true;
}
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index 76cc387cf7..0b40fb89cf 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -707,9 +707,7 @@ static void schedule_resize(struct vo_wayland_state *wl,
wl->window.sh_height = height;
wl->window.sh_x = x;
wl->window.sh_y = y;
- wl->window.events |= VO_EVENT_WIN_STATE | VO_EVENT_RESIZE;
- wl->vo->dwidth = width;
- wl->vo->dheight = height;
+ wl->window.events |= VO_EVENT_RESIZE;
}
static void frame_callback(void *data,
@@ -976,6 +974,8 @@ static void vo_wayland_fullscreen(struct vo *vo)
wl->window.is_fullscreen = true;
wl->window.p_width = wl->window.width;
wl->window.p_height = wl->window.height;
+ schedule_resize(wl, 0, wl->display.current_output->width,
+ wl->display.current_output->height);
wl_shell_surface_set_fullscreen(wl->window.shell_surface,
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
0, fs_output);
@@ -1040,6 +1040,7 @@ int vo_wayland_control(struct vo *vo, int *events, int request, void *arg)
switch (request) {
case VOCTRL_CHECK_EVENTS:
*events |= wl->window.events;
+ wl->window.events = 0;
return VO_TRUE;
case VOCTRL_FULLSCREEN:
vo->opts->fullscreen = !vo->opts->fullscreen;