summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--video/out/x11_common.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index 38fdca73df..09248ddfd0 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -1884,21 +1884,23 @@ int vo_x11_control(struct vo *vo, int *events, int request, void *arg)
int *s = arg;
if (!x11->window || x11->parent)
return VO_FALSE;
- s[0] = x11->fs ? RC_W(x11->nofsrc) : RC_W(x11->winrc);
- s[1] = x11->fs ? RC_H(x11->nofsrc) : RC_H(x11->winrc);
+ s[0] = (x11->fs ? RC_W(x11->nofsrc) : RC_W(x11->winrc)) / x11->dpi_scale;
+ s[1] = (x11->fs ? RC_H(x11->nofsrc) : RC_H(x11->winrc)) / x11->dpi_scale;
return VO_TRUE;
}
case VOCTRL_SET_UNFS_WINDOW_SIZE: {
int *s = arg;
if (!x11->window || x11->parent)
return VO_FALSE;
+ int w = s[0] * x11->dpi_scale;
+ int h = s[1] * x11->dpi_scale;
struct mp_rect rc = x11->winrc;
- rc.x1 = rc.x0 + s[0];
- rc.y1 = rc.y0 + s[1];
+ rc.x1 = rc.x0 + w;
+ rc.y1 = rc.y0 + h;
vo_x11_highlevel_resize(vo, rc);
if (!x11->fs) { // guess new window size, instead of waiting for X
- x11->winrc.x1 = x11->winrc.x0 + s[0];
- x11->winrc.y1 = x11->winrc.y0 + s[1];
+ x11->winrc.x1 = x11->winrc.x0 + w;
+ x11->winrc.y1 = x11->winrc.y0 + h;
}
return VO_TRUE;
}