55#include " render/scene/input_area.h"
66#include " wayland/wayland_connection.h"
77
8+ #include < cstdint>
9+
10+ namespace {
11+ // Edge length (logical px) of each corner trigger surface. The cursor pins to the
12+ // exact corner pixel on a flick, so a tiny zone suffices; keep it minimal to
13+ // barely intercept pointer input over surfaces beneath it.
14+ constexpr std::int32_t kTriggerZoneSize = 2 ;
15+ } // namespace
16+
817HotCorners::HotCorners (Application* app) : m_app(app) {}
918
1019HotCorners::~HotCorners () { destroySurfaces (); }
@@ -71,7 +80,12 @@ void HotCorners::triggerAction(const std::string& action, const std::string& com
7180}
7281
7382void HotCorners::buildCorner (Corner& corner, int position, wl_output* output) {
74- LayerShellLayer layer = LayerShellLayer::Bottom;
83+ // Overlay layer (topmost) + created after the bar/dock so the trigger zone is
84+ // never occluded by shell chrome in the corner (a Top-layer bar would otherwise
85+ // swallow the pointer). Transient surfaces opened later (panels, popups, the
86+ // lock screen) are created after these and still stack above them.
87+ const LayerShellLayer layer = LayerShellLayer::Overlay;
88+ constexpr std::int32_t size = kTriggerZoneSize ;
7589
7690 std::uint32_t anchor = 0 ;
7791 std::string cornerKey;
@@ -93,18 +107,19 @@ void HotCorners::buildCorner(Corner& corner, int position, wl_output* output) {
93107 .nameSpace = " hot_corner_" + cornerKey,
94108 .layer = layer,
95109 .anchor = anchor,
96- .width = 1 ,
97- .height = 1 ,
98- .exclusiveZone = 0 ,
110+ .width = static_cast <std::uint32_t >(size),
111+ .height = static_cast <std::uint32_t >(size),
112+ // -1: ignore other surfaces' exclusive zones so the corner anchors to the
113+ // absolute screen edge instead of being pushed inward by the bar's zone.
114+ .exclusiveZone = -1 ,
99115 };
100116
101117 corner.surface = std::make_unique<LayerSurface>(*m_wayland, surfaceConfig);
102118 corner.surface ->initialize (output);
103119
104120 auto inputArea = std::make_unique<InputArea>();
105- // 1x1 region
106121 inputArea->setPosition (0 , 0 );
107- inputArea->setSize (1 , 1 );
122+ inputArea->setSize (static_cast < float >(size), static_cast < float >(size) );
108123 inputArea->setOnEnter ([this , position, output](const InputArea::PointerData&) {
109124 const auto & config = m_config->config ().hotCorners ;
110125 std::string action;
0 commit comments