summaryrefslogtreecommitdiffstats
path: root/video/out/wayland_common.h
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-01-23 14:16:43 -0600
committerDudemanguy <random342@airmail.cc>2023-01-24 00:04:39 +0000
commit879824a47f50f7e93f85992c92d03f37129605f4 (patch)
tree6e69209e1fe4fa0019fe51384ab15d1335f170ec /video/out/wayland_common.h
parent006ec9ce4357cd198955bc2e56caec34943db52d (diff)
downloadmpv-879824a47f50f7e93f85992c92d03f37129605f4.tar.bz2
mpv-879824a47f50f7e93f85992c92d03f37129605f4.tar.xz
wayland: add wp-fractional-scale-v1 support
This protocol is pretty important since it finally lets us solve the longstanding issue of fractional scaling in wayland (no more mpv doing rendering over the target resolution and then being scaled down). This protocol also can completely replace the buffer_scale usage that we are currently using for integer scaling so hopefully this can be removed sometime in the future. Note that vo_dmabuf_wayland is omitted from the fractional scale handling because we want the compositor to handle all the scaling for that VO. Fixes #9443.
Diffstat (limited to 'video/out/wayland_common.h')
-rw-r--r--video/out/wayland_common.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/video/out/wayland_common.h b/video/out/wayland_common.h
index c073ae4250..fa65e80ac2 100644
--- a/video/out/wayland_common.h
+++ b/video/out/wayland_common.h
@@ -73,7 +73,7 @@ struct vo_wayland_state {
int mouse_x;
int mouse_y;
int pending_vo_events;
- int scaling;
+ double scaling;
int timeout_count;
int wakeup_pipe[2];
@@ -83,6 +83,11 @@ struct vo_wayland_state {
void *content_type;
int current_content_type;
+ /* fractional-scale */
+ /* TODO: unvoid these if required wayland protocols is bumped to 1.31+ */
+ void *fractional_scale_manager;
+ void *fractional_scale;
+
/* idle-inhibit */
struct zwp_idle_inhibit_manager_v1 *idle_inhibit_manager;
struct zwp_idle_inhibitor_v1 *idle_inhibitor;
@@ -156,6 +161,7 @@ bool vo_wayland_supported_format(struct vo *vo, uint32_t format, uint64_t modifi
int vo_wayland_allocate_memfd(struct vo *vo, size_t size);
int vo_wayland_control(struct vo *vo, int *events, int request, void *arg);
+void vo_wayland_handle_fractional_scale(struct vo_wayland_state *wl);
void vo_wayland_set_opaque_region(struct vo_wayland_state *wl, int alpha);
void vo_wayland_sync_swap(struct vo_wayland_state *wl);
void vo_wayland_uninit(struct vo *vo);