mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-09-22 12:07:15 +03:00
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 Status (* PFN_XShapeQueryVersion)(Display*dpy,int*,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 XShapeQueryVersion _glfw.x11.xshape.QueryVersion
|
||||
#define XShapeCombineRegion _glfw.x11.xshape.ShapeCombineRegion
|
||||
#define XShapeCombineMask _glfw.x11.xshape.ShapeCombineMask
|
||||
|
||||
typedef VkFlags VkXlibSurfaceCreateFlagsKHR;
|
||||
typedef VkFlags VkXcbSurfaceCreateFlagsKHR;
|
||||
@ -394,6 +397,7 @@ typedef struct _GLFWlibraryX11
|
||||
PFN_XShapeQueryExtension QueryExtension;
|
||||
PFN_XShapeCombineRegion ShapeCombineRegion;
|
||||
PFN_XShapeQueryVersion QueryVersion;
|
||||
PFN_XShapeCombineMask ShapeCombineMask;
|
||||
} xshape;
|
||||
|
||||
EventLoopData eventLoopData;
|
||||
|
26
glfw/x11_window.c
vendored
26
glfw/x11_window.c
vendored
@ -2594,21 +2594,19 @@ void _glfwPlatformSetWindowMousePassthrough(_GLFWwindow* window, bool enabled)
|
||||
if (enabled == window->mousePassthrough)
|
||||
return;
|
||||
|
||||
int width = 0;
|
||||
int height = 0;
|
||||
if (!enabled)
|
||||
_glfwPlatformGetWindowSize(window, &width, &height);
|
||||
if (enabled)
|
||||
{
|
||||
Region region = XCreateRegion();
|
||||
XShapeCombineRegion(_glfw.x11.display, window->x11.handle,
|
||||
2/*ShapeInput*/, 0, 0, region, 0/*ShapeSet*/);
|
||||
XDestroyRegion(region);
|
||||
}
|
||||
else
|
||||
{
|
||||
XShapeCombineMask(_glfw.x11.display, window->x11.handle,
|
||||
2/*ShapeInput*/, 0, 0, None, 0/*ShapeSet*/);
|
||||
}
|
||||
|
||||
XRectangle rect;
|
||||
rect.x = 0;
|
||||
rect.y = 0;
|
||||
rect.width = (unsigned short)width;
|
||||
rect.height = (unsigned short)height;
|
||||
|
||||
Region region = XCreateRegion();
|
||||
XUnionRectWithRegion(&rect, region, region);
|
||||
XShapeCombineRegion(_glfw.x11.display, window->x11.handle, 2/*ShapeInput*/, 0, 0, region, 0/*ShapeSet*/);
|
||||
XDestroyRegion(region);
|
||||
window->mousePassthrough = enabled;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user