summaryrefslogtreecommitdiffstats
path: root/video/out/w32_common.c
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2021-04-12 12:51:41 -0500
committerDudemanguy <random342@airmail.cc>2021-05-06 17:36:55 +0000
commita88fdfde0c91c16c84e6057b19bdc2fb9e666e24 (patch)
tree64bb28b8c231040510adfef3630a62bac592e5ae /video/out/w32_common.c
parent8edfe70b83acba3de91d41bf1c46921e969ea265 (diff)
downloadmpv-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/w32_common.c')
-rw-r--r--video/out/w32_common.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/video/out/w32_common.c b/video/out/w32_common.c
index 59cfd6199d..c819803a63 100644
--- a/video/out/w32_common.c
+++ b/video/out/w32_common.c
@@ -1768,6 +1768,11 @@ static int gui_thread_control(struct vo_w32_state *w32, int request, void *arg)
update_display_info(w32);
*(double*) arg = w32->display_fps;
return VO_TRUE;
+ case VOCTRL_GET_DISPLAY_RES: ;
+ RECT r = get_screen_area(w32);
+ ((int *)arg)[0] = r.right;
+ ((int *)arg)[1] = r.bottom;
+ return VO_TRUE;
case VOCTRL_GET_DISPLAY_NAMES:
*(char ***)arg = get_disp_names(w32);
return VO_TRUE;