summaryrefslogtreecommitdiffstats
path: root/video/out/wayland_common.h
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2016-05-30 18:34:31 +0100
committerwm4 <wm4@nowhere>2016-05-30 20:17:26 +0200
commit098ff4174c6c9cc59e65c6f09b23b3adaee03983 (patch)
treeac5c85fcb7519e6d394df6367a3422bd2652c553 /video/out/wayland_common.h
parent9009601c2d3b2a6d7806d63346c900e0a4c9e2ca (diff)
downloadmpv-098ff4174c6c9cc59e65c6f09b23b3adaee03983.tar.bz2
mpv-098ff4174c6c9cc59e65c6f09b23b3adaee03983.tar.xz
wayland: implement HIDPI support
The wayland protocol exposes scaling done by the compositor to compensate for small window sizes on small high DPI displays. If the program ignores the scaling done, what'll happen is the compositor is going to ask the program to be scaled down by N times the window size and then it'll upscale the program's surface by N times. The scaling algorithm seems to be bilinear so the scaling is quite obvious. This commit sets up callbacks to listen for the scaling factor of each output and, on rescale events, notifies the compositor that the surface's scale is what the compositor asked for and changes the player's surface to the appropriate size, causing no scaling to be done by the compositor. Compositors not supporting this interface will ignore the callbacks and do nothing, keeping program behaviour the same. For compositors supporting and using this interface (mutter), this will fix the rendering to be pixel precise as it should be. Both the opengl wayland backend and the wayland vo have been fixed to support this. Verified to not break either on weston and mutter. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Diffstat (limited to 'video/out/wayland_common.h')
-rw-r--r--video/out/wayland_common.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/video/out/wayland_common.h b/video/out/wayland_common.h
index d23b2f24c7..ec3f72ce67 100644
--- a/video/out/wayland_common.h
+++ b/video/out/wayland_common.h
@@ -41,6 +41,7 @@ struct vo_wayland_output {
uint32_t flags;
int32_t width;
int32_t height;
+ int32_t scale;
int32_t refresh_rate; // fps (mHz)
const char *make;
const char *model;