aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWebFreak001 <gh@webfreak.org>2020-06-12 23:07:38 +0200
committerdec05eba <dec05eba@protonmail.com>2020-06-13 07:21:25 +0200
commit033638c9a0fa86ae2ad3c3b3483fb001d179b9eb (patch)
tree0e3ef2715466ac5c4a9edeaa962e0b018616d0b9
parentacf78efd44c8c15f5167f5436c7fa9295108382a (diff)
try to improve capture a little bit
I'm not too sure if the pixmap config part actually changes something like this but the API of glXCreatePixmap says it will result in a BadMatch error if the window doesn't have the GLX_WINDOW_BIT. Also adds some XSync calls which help debugging crashes.
-rw-r--r--src/window_texture.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/window_texture.c b/src/window_texture.c
index d899266..71c584b 100644
--- a/src/window_texture.c
+++ b/src/window_texture.c
@@ -55,7 +55,7 @@ int window_texture_on_resize(WindowTexture *self) {
const int pixmap_config[] = {
GLX_BIND_TO_TEXTURE_RGBA_EXT, True,
- GLX_DRAWABLE_TYPE, GLX_PIXMAP_BIT,
+ GLX_DRAWABLE_TYPE, GLX_PIXMAP_BIT | GLX_WINDOW_BIT,
GLX_BIND_TO_TEXTURE_TARGETS_EXT, GLX_TEXTURE_2D_BIT_EXT,
/*GLX_BIND_TO_MIPMAP_TEXTURE_EXT, True,*/
GLX_DOUBLEBUFFER, False,
@@ -76,12 +76,16 @@ int window_texture_on_resize(WindowTexture *self) {
if(!configs)
return 1;
+ XSync(self->display, 0);
+
self->pixmap = XCompositeNameWindowPixmap(self->display, self->window);
if(!self->pixmap) {
result = 2;
goto cleanup;
}
+ XSync(self->display, 0);
+
self->glx_pixmap = glXCreatePixmap(self->display, configs[0], self->pixmap, pixmap_attribs);
if(!self->glx_pixmap) {
result = 3;