From 68e4261d73295cc280ee3d060d421e0ace5d8d11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Mon, 6 Jul 2020 23:15:20 +0200 Subject: [PATCH] X11: Include X Shape extension headers Related to #1568. --- .travis.yml | 2 ++ CMakeLists.txt | 5 +++++ src/x11_platform.h | 3 +++ src/x11_window.c | 4 ++-- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index bc924a90..4fb1a6bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,7 @@ matrix: - libxinerama-dev - libxcursor-dev - libxi-dev + - libxext-dev env: - BUILD_SHARED_LIBS=ON - CFLAGS=-Werror @@ -30,6 +31,7 @@ matrix: - libxinerama-dev - libxcursor-dev - libxi-dev + - libxext-dev env: - BUILD_SHARED_LIBS=OFF - CFLAGS=-Werror diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f7ad4ca..baeddbfb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -176,6 +176,11 @@ if (_GLFW_X11) if (NOT X11_Xi_INCLUDE_PATH) message(FATAL_ERROR "XInput headers not found; install libxi development package") endif() + + # Check for X Shape (custom window input shape) + if (NOT X11_Xshape_INCLUDE_PATH) + message(FATAL_ERROR "X Shape headers not found; install libxext development package") + endif() endif() #-------------------------------------------------------------------- diff --git a/src/x11_platform.h b/src/x11_platform.h index c879df4c..c5137bc3 100644 --- a/src/x11_platform.h +++ b/src/x11_platform.h @@ -48,6 +48,9 @@ // The XInput extension provides raw mouse motion input #include +// The Shape extension provides custom window shapes +#include + typedef XClassHint* (* PFN_XAllocClassHint)(void); typedef XSizeHints* (* PFN_XAllocSizeHints)(void); typedef XWMHints* (* PFN_XAllocWMHints)(void); diff --git a/src/x11_window.c b/src/x11_window.c index 566dfae0..88c145e1 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -2714,13 +2714,13 @@ void _glfwPlatformSetWindowMousePassthrough(_GLFWwindow* window, GLFWbool enable { Region region = XCreateRegion(); XShapeCombineRegion(_glfw.x11.display, window->x11.handle, - 2/*ShapeInput*/, 0, 0, region, 0/*ShapeSet*/); + ShapeInput, 0, 0, region, ShapeSet); XDestroyRegion(region); } else { XShapeCombineMask(_glfw.x11.display, window->x11.handle, - 2/*ShapeInput*/, 0, 0, None, 0/*ShapeSet*/); + ShapeInput, 0, 0, None, ShapeSet); } window->mousePassthrough = enabled;