diff options
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/wayland_common.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 49412ee46c..90d4e162e4 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -2118,16 +2118,28 @@ int vo_wayland_control(struct vo *vo, int *events, int request, void *arg) return VO_TRUE; } case VOCTRL_GET_DISPLAY_FPS: { - if (!wl->current_output) + struct vo_wayland_output *out; + if (wl->current_output) { + out = wl->current_output; + } else { + out = find_output(wl); + } + if (!out) return VO_NOTAVAIL; - *(double *)arg = wl->current_output->refresh_rate; + *(double *)arg = out->refresh_rate; return VO_TRUE; } case VOCTRL_GET_DISPLAY_RES: { - if (!wl->current_output) + struct vo_wayland_output *out; + if (wl->current_output) { + out = wl->current_output; + } else { + out = find_output(wl); + } + if (!out) return VO_NOTAVAIL; - ((int *)arg)[0] = wl->current_output->geometry.x1; - ((int *)arg)[1] = wl->current_output->geometry.y1; + ((int *)arg)[0] = out->geometry.x1; + ((int *)arg)[1] = out->geometry.y1; return VO_TRUE; } case VOCTRL_GET_HIDPI_SCALE: { |