summaryrefslogtreecommitdiffstats
path: root/video/out/vo_xv.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-27 21:33:11 +0200
committerwm4 <wm4@nowhere>2014-07-27 21:33:11 +0200
commit89391e7c949216d7edec461e9bb2cb6c787475c6 (patch)
tree0607c4609ffe505f810403585d54c8fa233e164f /video/out/vo_xv.c
parentbc6359313f55ef42e2e4737323844a224f17730b (diff)
downloadmpv-89391e7c949216d7edec461e9bb2cb6c787475c6.tar.bz2
mpv-89391e7c949216d7edec461e9bb2cb6c787475c6.tar.xz
vo: different hack for VOs which need to mangle mouse input
Follow up on commit 760548da. Mouse handling is a bit confusing, because there are at least 3 coordinate systems associated with it, and it should be cleaned up. But that is hard, so just apply a hack which gets the currently-annoying issue (VO backends needing access to the VO) out of the way.
Diffstat (limited to 'video/out/vo_xv.c')
-rw-r--r--video/out/vo_xv.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/video/out/vo_xv.c b/video/out/vo_xv.c
index e8f0fcd490..1ea16558ac 100644
--- a/video/out/vo_xv.c
+++ b/video/out/vo_xv.c
@@ -57,6 +57,7 @@
#include "sub/draw_bmp.h"
#include "video/csputils.h"
#include "options/m_option.h"
+#include "input/input.h"
#include "osdep/timer.h"
#define CK_METHOD_NONE 0 // no colorkey drawing
@@ -412,6 +413,8 @@ static void resize(struct vo *vo)
xv_draw_colorkey(vo, &ctx->dst_rect);
read_xv_csp(vo);
+ mp_input_set_mouse_transform(vo->input_ctx, &ctx->dst_rect, &ctx->src_rect);
+
vo->want_redraw = true;
}
@@ -843,16 +846,6 @@ static int control(struct vo *vo, uint32_t request, void *data)
args->out_image = get_screenshot(vo);
return true;
}
- case VOCTRL_WINDOW_TO_OSD_COORDS: {
- float *c = data;
- struct mp_rect *src = &ctx->src_rect;
- struct mp_rect *dst = &ctx->dst_rect;
- c[0] = av_clipf(c[0], dst->x0, dst->x1) - dst->x0;
- c[1] = av_clipf(c[1], dst->y0, dst->y1) - dst->y0;
- c[0] = c[0] / (dst->x1 - dst->x0) * (src->x1 - src->x0) + src->x0;
- c[1] = c[1] / (dst->y1 - dst->y0) * (src->y1 - src->y0) + src->y0;
- return VO_TRUE;
- }
}
int events = 0;
int r = vo_x11_control(vo, &events, request, data);
@@ -866,7 +859,6 @@ static int control(struct vo *vo, uint32_t request, void *data)
const struct vo_driver video_out_xv = {
.description = "X11/Xv",
.name = "xv",
- .caps = VO_CAP_EVIL_OSD,
.preinit = preinit,
.query_format = query_format,
.reconfig = reconfig,