diff options
author | Dudemanguy <random342@airmail.cc> | 2021-04-12 12:51:41 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2021-05-06 17:36:55 +0000 |
commit | a88fdfde0c91c16c84e6057b19bdc2fb9e666e24 (patch) | |
tree | 64bb28b8c231040510adfef3630a62bac592e5ae /video/out/wayland_common.c | |
parent | 8edfe70b83acba3de91d41bf1c46921e969ea265 (diff) | |
download | mpv-a88fdfde0c91c16c84e6057b19bdc2fb9e666e24.tar.bz2 mpv-a88fdfde0c91c16c84e6057b19bdc2fb9e666e24.tar.xz |
command: add display-width/display-height property
For some reason, this never existed before. Add VOCTRL_GET_DISPLAY_RES
and use it to obtain the current display's resolution from each
vo/windowing backend if applicable. Users can then access the current
display resolution as display-width and display-height as per the client
api. Note that macOS/cocoa was not attempted in this commit since the
author has no clue how to write swift.
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r-- | video/out/wayland_common.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 94e839ef34..1902475ead 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -1754,6 +1754,13 @@ int vo_wayland_control(struct vo *vo, int *events, int request, void *arg) *(double *)arg = wl->current_output->refresh_rate; return VO_TRUE; } + case VOCTRL_GET_DISPLAY_RES: { + if (!wl->current_output) + return VO_NOTAVAIL; + ((int *)arg)[0] = wl->current_output->geometry.x1; + ((int *)arg)[1] = wl->current_output->geometry.y1; + return VO_TRUE; + } case VOCTRL_GET_HIDPI_SCALE: { if (!wl->scaling) return VO_NOTAVAIL; |