aboutsummaryrefslogtreecommitdiff
path: root/src/capture/xcomposite.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-07-15 18:57:33 +0200
committerdec05eba <dec05eba@protonmail.com>2024-07-15 19:02:34 +0200
commit048b8d21ecbd1168ff8e033b12cbfd66bba0127c (patch)
treef536c35090a6ed78803d064c0784370a2424ca7a /src/capture/xcomposite.c
parentc447a9a35f51815db307e5d58630040cd63ad4b7 (diff)
Add support for desktop portal capture (-w portal)
Diffstat (limited to 'src/capture/xcomposite.c')
-rw-r--r--src/capture/xcomposite.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/src/capture/xcomposite.c b/src/capture/xcomposite.c
index f5d2b2f..83c4800 100644
--- a/src/capture/xcomposite.c
+++ b/src/capture/xcomposite.c
@@ -351,23 +351,15 @@ static int gsr_capture_xcomposite_capture(gsr_capture *cap, AVFrame *frame, gsr_
if(self->params.record_cursor && self->cursor.visible) {
gsr_cursor_tick(&self->cursor, self->window);
- 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.y;
-
- if(cursor_inside_window) {
- self->params.egl->glEnable(GL_SCISSOR_TEST);
- self->params.egl->glScissor(target_x, target_y, self->texture_size.x, self->texture_size.y);
-
- gsr_color_conversion_draw(color_conversion, self->cursor.texture_id,
- cursor_pos, self->cursor.size,
- (vec2i){0, 0}, self->cursor.size,
- 0.0f, false);
-
- self->params.egl->glDisable(GL_SCISSOR_TEST);
- }
+ self->params.egl->glEnable(GL_SCISSOR_TEST);
+ self->params.egl->glScissor(target_x, target_y, self->texture_size.x, self->texture_size.y);
+
+ gsr_color_conversion_draw(color_conversion, self->cursor.texture_id,
+ cursor_pos, self->cursor.size,
+ (vec2i){0, 0}, self->cursor.size,
+ 0.0f, false);
+
+ self->params.egl->glDisable(GL_SCISSOR_TEST);
}
self->params.egl->eglSwapBuffers(self->params.egl->egl_display, self->params.egl->egl_surface);