aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-07-05 11:55:56 +0200
committerdec05eba <dec05eba@protonmail.com>2024-07-05 11:55:56 +0200
commita5720df10fa0a40e1438e18b254925361bb623b8 (patch)
treeb9e3a7424729f571a8f6ab748fd8312021654bfa
parent56e9d15e0f9fb5c6ccaa9525dd7ec7a93659f6f7 (diff)
Nicer window focus transition for padding handling
-rw-r--r--src/capture/xcomposite.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/capture/xcomposite.c b/src/capture/xcomposite.c
index 4f89e11..f5d2b2f 100644
--- a/src/capture/xcomposite.c
+++ b/src/capture/xcomposite.c
@@ -258,10 +258,20 @@ static void gsr_capture_xcomposite_tick(gsr_capture *cap, AVCodecContext *video_
self->window_size.x = max_int(attr.width, 0);
self->window_size.y = max_int(attr.height, 0);
- self->window_resized = true;
window_texture_deinit(&self->window_texture);
window_texture_init(&self->window_texture, self->params.egl->x11.dpy, self->window, self->params.egl); // TODO: Do not do the below window_texture_on_resize after this
+
+ self->texture_size.x = 0;
+ self->texture_size.y = 0;
+
+ self->params.egl->glBindTexture(GL_TEXTURE_2D, window_texture_get_opengl_texture_id(&self->window_texture));
+ self->params.egl->glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &self->texture_size.x);
+ self->params.egl->glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &self->texture_size.y);
+ self->params.egl->glBindTexture(GL_TEXTURE_2D, 0);
+
+ self->window_resized = false;
+ self->clear_background = true;
gsr_capture_xcomposite_setup_damage(self, self->window);
}
}