Correctly clear cursor in window capture when the cursor is outside the

window
This commit is contained in:
dec05eba
2024-03-21 19:19:57 +01:00
parent b19f88d769
commit 799120ab5f

View File

@@ -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;