diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2023-01-17 09:01:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-17 09:01:58 +0100 |
commit | 5a39c63ebbd0e28ae7168124ffd7269f001db288 (patch) | |
tree | 7189046e7114fd2476b6ae3281d07d6efd7cc8ef /platform/linuxbsd | |
parent | f53d8c3e5797b9906e034af1a42fb84dee752042 (diff) | |
parent | 60e00430128afad6408b02b4139bcf405d87b50b (diff) |
Merge pull request #71540 from bruvzg/x11_inp_region
Fix X11 input region size.
Diffstat (limited to 'platform/linuxbsd')
-rw-r--r-- | platform/linuxbsd/x11/display_server_x11.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/platform/linuxbsd/x11/display_server_x11.cpp b/platform/linuxbsd/x11/display_server_x11.cpp index a2c34bb874..2cb00728c8 100644 --- a/platform/linuxbsd/x11/display_server_x11.cpp +++ b/platform/linuxbsd/x11/display_server_x11.cpp @@ -1432,28 +1432,23 @@ void DisplayServerX11::_update_window_mouse_passthrough(WindowID p_window) { int event_base, error_base; const Bool ext_okay = XShapeQueryExtension(x11_display, &event_base, &error_base); if (ext_okay) { - Region region; if (windows[p_window].mpass) { - region = XCreateRegion(); + Region region = XCreateRegion(); + XShapeCombineRegion(x11_display, windows[p_window].x11_window, ShapeInput, 0, 0, region, ShapeSet); + XDestroyRegion(region); } else if (region_path.size() == 0) { - region = XCreateRegion(); - XRectangle rect; - rect.x = 0; - rect.y = 0; - rect.width = window_get_size_with_decorations(p_window).x; - rect.height = window_get_size_with_decorations(p_window).y; - XUnionRectWithRegion(&rect, region, region); + XShapeCombineMask(x11_display, windows[p_window].x11_window, ShapeInput, 0, 0, None, ShapeSet); } else { XPoint *points = (XPoint *)memalloc(sizeof(XPoint) * region_path.size()); for (int i = 0; i < region_path.size(); i++) { points[i].x = region_path[i].x; points[i].y = region_path[i].y; } - region = XPolygonRegion(points, region_path.size(), EvenOddRule); + Region region = XPolygonRegion(points, region_path.size(), EvenOddRule); memfree(points); + XShapeCombineRegion(x11_display, windows[p_window].x11_window, ShapeInput, 0, 0, region, ShapeSet); + XDestroyRegion(region); } - XShapeCombineRegion(x11_display, windows[p_window].x11_window, ShapeInput, 0, 0, region, ShapeSet); - XDestroyRegion(region); } } |