summaryrefslogtreecommitdiff
path: root/gui-libs/pixdecor/files/pixdecor-corner-resize.patch
blob: 48c5b1ce13ab666267fd556a49182063cf8fecd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/src/deco-subsurface.cpp b/src/deco-subsurface.cpp
index f626204..8eb57e9 100644
--- a/src/deco-subsurface.cpp
+++ b/src/deco-subsurface.cpp
@@ -263,7 +263,12 @@ class simple_decoration_node_t : public wf::scene::node_t, public wf::pointer_in
                     const double x = local.x - shadow, y = local.y - shadow;
                     const double dx = std::max({radius - x, 0.0, x - (w - radius)});
                     const double dy = std::max({radius - y, 0.0, y - (h - radius)});
-                    if (dx > 0 && dy > 0 && dx * dx + dy * dy > radius * radius)
+                    // Keep the corner resize handles (where the layout's edge
+                    // handles overlap, see calculate_resize_edges()) hittable.
+                    const double handle = theme.get_input_size();
+                    const bool corner_handle = std::min(x, w - x) < handle &&
+                        std::min(y, h - y) < handle;
+                    if (!corner_handle && dx > 0 && dy > 0 && dx * dx + dy * dy > radius * radius)
                     {
                         return {};
                     }