GLFW: X11: Fix disabling of GLFW_MOUSE_PASSTHROUGH
From upstream: e81d381256.
This commit is contained in:
parent
d0c6ce9fd7
commit
6a472bd6da
4
glfw/x11_platform.h
vendored
4
glfw/x11_platform.h
vendored
@ -128,9 +128,12 @@ typedef XRenderPictFormat* (* PFN_XRenderFindVisualFormat)(Display*,Visual const
|
|||||||
typedef Bool (* PFN_XShapeQueryExtension)(Display*,int*,int*);
|
typedef Bool (* PFN_XShapeQueryExtension)(Display*,int*,int*);
|
||||||
typedef Status (* PFN_XShapeQueryVersion)(Display*dpy,int*,int*);
|
typedef Status (* PFN_XShapeQueryVersion)(Display*dpy,int*,int*);
|
||||||
typedef void (* PFN_XShapeCombineRegion)(Display*,Window,int,int,int,Region,int);
|
typedef void (* PFN_XShapeCombineRegion)(Display*,Window,int,int,int,Region,int);
|
||||||
|
typedef void (* PFN_XShapeCombineMask)(Display*,Window,int,int,int,Pixmap,int);
|
||||||
|
|
||||||
#define XShapeQueryExtension _glfw.x11.xshape.QueryExtension
|
#define XShapeQueryExtension _glfw.x11.xshape.QueryExtension
|
||||||
#define XShapeQueryVersion _glfw.x11.xshape.QueryVersion
|
#define XShapeQueryVersion _glfw.x11.xshape.QueryVersion
|
||||||
#define XShapeCombineRegion _glfw.x11.xshape.ShapeCombineRegion
|
#define XShapeCombineRegion _glfw.x11.xshape.ShapeCombineRegion
|
||||||
|
#define XShapeCombineMask _glfw.x11.xshape.ShapeCombineMask
|
||||||
|
|
||||||
typedef VkFlags VkXlibSurfaceCreateFlagsKHR;
|
typedef VkFlags VkXlibSurfaceCreateFlagsKHR;
|
||||||
typedef VkFlags VkXcbSurfaceCreateFlagsKHR;
|
typedef VkFlags VkXcbSurfaceCreateFlagsKHR;
|
||||||
@ -394,6 +397,7 @@ typedef struct _GLFWlibraryX11
|
|||||||
PFN_XShapeQueryExtension QueryExtension;
|
PFN_XShapeQueryExtension QueryExtension;
|
||||||
PFN_XShapeCombineRegion ShapeCombineRegion;
|
PFN_XShapeCombineRegion ShapeCombineRegion;
|
||||||
PFN_XShapeQueryVersion QueryVersion;
|
PFN_XShapeQueryVersion QueryVersion;
|
||||||
|
PFN_XShapeCombineMask ShapeCombineMask;
|
||||||
} xshape;
|
} xshape;
|
||||||
|
|
||||||
EventLoopData eventLoopData;
|
EventLoopData eventLoopData;
|
||||||
|
|||||||
24
glfw/x11_window.c
vendored
24
glfw/x11_window.c
vendored
@ -2594,21 +2594,19 @@ void _glfwPlatformSetWindowMousePassthrough(_GLFWwindow* window, bool enabled)
|
|||||||
if (enabled == window->mousePassthrough)
|
if (enabled == window->mousePassthrough)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int width = 0;
|
if (enabled)
|
||||||
int height = 0;
|
{
|
||||||
if (!enabled)
|
|
||||||
_glfwPlatformGetWindowSize(window, &width, &height);
|
|
||||||
|
|
||||||
XRectangle rect;
|
|
||||||
rect.x = 0;
|
|
||||||
rect.y = 0;
|
|
||||||
rect.width = (unsigned short)width;
|
|
||||||
rect.height = (unsigned short)height;
|
|
||||||
|
|
||||||
Region region = XCreateRegion();
|
Region region = XCreateRegion();
|
||||||
XUnionRectWithRegion(&rect, region, region);
|
XShapeCombineRegion(_glfw.x11.display, window->x11.handle,
|
||||||
XShapeCombineRegion(_glfw.x11.display, window->x11.handle, 2/*ShapeInput*/, 0, 0, region, 0/*ShapeSet*/);
|
2/*ShapeInput*/, 0, 0, region, 0/*ShapeSet*/);
|
||||||
XDestroyRegion(region);
|
XDestroyRegion(region);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
XShapeCombineMask(_glfw.x11.display, window->x11.handle,
|
||||||
|
2/*ShapeInput*/, 0, 0, None, 0/*ShapeSet*/);
|
||||||
|
}
|
||||||
|
|
||||||
window->mousePassthrough = enabled;
|
window->mousePassthrough = enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user