From: Mikko Rasa Date: Fri, 11 Dec 2015 15:32:47 +0000 (+0200) Subject: Use the shape extension to let input events through the overlay window X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=42750151d3f9fed56dc333ec7949c9a8005570b0;p=geometrycompositor.git Use the shape extension to let input events through the overlay window --- diff --git a/Makefile b/Makefile index 63e1992..adb93d9 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,2 @@ geometrycompositor: source/main.c - gcc -o $@ $< -Wall -Wextra -Werror -ggdb -lX11 -lXcomposite -lXdamage -lGL + gcc -o $@ $< -Wall -Wextra -Werror -ggdb -lX11 -lXcomposite -lXdamage -lXext -lGL diff --git a/source/main.c b/source/main.c index 21189b6..3532854 100644 --- a/source/main.c +++ b/source/main.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include @@ -328,6 +329,7 @@ int initialize_screen(Compositor *compositor, unsigned number) XSelectInput(compositor->display, screen->root, SubstructureNotifyMask); screen->overlay = XCompositeGetOverlayWindow(compositor->display, screen->root); XGetGeometry(compositor->display, screen->overlay, &dummy_root, &x, &y, &screen->width, &screen->height, &border, &depth); + XShapeCombineRectangles(compositor->display, screen->overlay, ShapeInput, 0, 0, NULL, 0, ShapeSet, Unsorted); if(!initialize_gl(compositor, screen)) return 0; @@ -382,6 +384,13 @@ int initialize_compositor(Compositor *compositor) else if(major_ver<1) return with_error("XDamage 1.0 or later is required"); + if(!XShapeQueryExtension(compositor->display, &event_base, &error_base)) + return with_error("XShape is required but was not found"); + else if(!XShapeQueryVersion(compositor->display, &major_ver, &minor_ver)) + return with_error("Cannot determine XShape version"); + else if(major_ver<1 || (major_ver==1 && minor_ver<1)) + return with_error("XShape 1.1 or later is required"); + compositor->glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)glXGetProcAddress((unsigned char *)"glXCreateContextAttribsARB"); compositor->glXBindTexImageEXT = (PFNGLXBINDTEXIMAGEEXTPROC)glXGetProcAddress((unsigned char *)"glXBindTexImageEXT"); compositor->glXReleaseTexImageEXT = (PFNGLXRELEASETEXIMAGEEXTPROC)glXGetProcAddress((unsigned char *)"glXReleaseTexImageEXT");