From 799120ab5fd0f4b454d9a08b412b17f8382058d8 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 21 Mar 2024 19:19:57 +0100 Subject: Correctly clear cursor in window capture when the cursor is outside the window --- src/capture/xcomposite.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/capture/xcomposite.c b/src/capture/xcomposite.c index 15d560d..29b42d5 100644 --- a/src/capture/xcomposite.c +++ b/src/capture/xcomposite.c @@ -256,15 +256,15 @@ int gsr_capture_xcomposite_capture(gsr_capture_xcomposite *self, AVFrame *frame) const bool cursor_completely_inside_window = cursor_pos.x >= target_x && - cursor_pos.x <= target_x + self->texture_size.x && + cursor_pos.x + self->cursor.size.x <= target_x + self->texture_size.x && cursor_pos.y >= target_y && - cursor_pos.y <= target_y + self->texture_size.x; + cursor_pos.y + self->cursor.size.y <= target_y + self->texture_size.y; const bool cursor_inside_window = cursor_pos.x + self->cursor.size.x >= target_x && cursor_pos.x <= target_x + self->texture_size.x && cursor_pos.y + self->cursor.size.y >= target_y && - cursor_pos.y <= target_y + self->texture_size.x; + cursor_pos.y <= target_y + self->texture_size.y; if(self->clear_next_frame) { self->clear_next_frame = false; -- cgit v1.2.3