summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/context_wayland.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/opengl/context_wayland.c')
-rw-r--r--video/out/opengl/context_wayland.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/video/out/opengl/context_wayland.c b/video/out/opengl/context_wayland.c
index a100073780..e74132bcf2 100644
--- a/video/out/opengl/context_wayland.c
+++ b/video/out/opengl/context_wayland.c
@@ -25,10 +25,14 @@ static void egl_resize(struct vo_wayland_state *wl)
int32_t y = wl->window.sh_y;
int32_t width = wl->window.sh_width;
int32_t height = wl->window.sh_height;
+ int32_t scale = 1;
if (!wl->egl_context.egl_window)
return;
+ if (wl->display.current_output)
+ scale = wl->display.current_output->scale;
+
// get the real size of the window
// this improves moving the window while resizing it
wl_egl_window_get_attached_size(wl->egl_context.egl_window,
@@ -46,14 +50,15 @@ static void egl_resize(struct vo_wayland_state *wl)
if (y != 0)
y = wl->window.height - height;
- wl_egl_window_resize(wl->egl_context.egl_window, width, height, x, y);
+ wl_surface_set_buffer_scale(wl->window.video_surface, scale);
+ wl_egl_window_resize(wl->egl_context.egl_window, scale*width, scale*height, x, y);
wl->window.width = width;
wl->window.height = height;
/* set size for mplayer */
- wl->vo->dwidth = wl->window.width;
- wl->vo->dheight = wl->window.height;
+ wl->vo->dwidth = scale*wl->window.width;
+ wl->vo->dheight = scale*wl->window.height;
wl->vo->want_redraw = true;
wl->window.events = 0;