From 07ce3742019c3aa4599649bce4dffc1e9013ddff Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 26 Oct 2024 23:55:41 +0200 Subject: Fix cursor position when scaling output with multiple monitors on monitor capture on x11 --- src/capture/kms.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/capture') diff --git a/src/capture/kms.c b/src/capture/kms.c index fdb1ced..829fc6a 100644 --- a/src/capture/kms.c +++ b/src/capture/kms.c @@ -524,8 +524,8 @@ static void render_x11_cursor(gsr_capture_kms *self, gsr_color_conversion *color gsr_cursor_tick(&self->x11_cursor, DefaultRootWindow(self->params.egl->x11.dpy)); const vec2i cursor_pos = { - target_pos.x + (self->x11_cursor.position.x - self->x11_cursor.hotspot.x) * scale.x - capture_pos.x, - target_pos.y + (self->x11_cursor.position.y - self->x11_cursor.hotspot.y) * scale.y - capture_pos.y + target_pos.x + (self->x11_cursor.position.x - self->x11_cursor.hotspot.x - capture_pos.x) * scale.x, + target_pos.y + (self->x11_cursor.position.y - self->x11_cursor.hotspot.y - capture_pos.y) * scale.y }; self->params.egl->glEnable(GL_SCISSOR_TEST); -- cgit v1.2.3