aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/managers/PointerManager.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/managers/PointerManager.cpp b/src/managers/PointerManager.cpp
index 6b2a40f5..90652526 100644
--- a/src/managers/PointerManager.cpp
+++ b/src/managers/PointerManager.cpp
@@ -307,6 +307,8 @@ void CPointerManager::resetCursorImage(bool apply) {
void CPointerManager::updateCursorBackend() {
static auto PNOHW = CConfigValue<Hyprlang::INT>("cursor:no_hardware_cursors");
+ const auto CURSORBOX = getCursorBoxGlobal();
+
for (auto const& m : g_pCompositor->m_vMonitors) {
auto state = stateFor(m);
@@ -315,6 +317,17 @@ void CPointerManager::updateCursorBackend() {
continue;
}
+ auto CROSSES = !m->logicalBox().intersection(CURSORBOX).empty();
+
+ if (!CROSSES) {
+ if (state->cursorFrontBuffer) {
+ Debug::log(TRACE, "Output {}: cursor left the viewport, removing it from the backend", m->szName);
+ setHWCursorBuffer(state, nullptr);
+ }
+
+ continue;
+ }
+
if (state->softwareLocks > 0 || *PNOHW || !attemptHardwareCursor(state)) {
Debug::log(TRACE, "Output {} rejected hardware cursors, falling back to sw", m->szName);
state->box = getCursorBoxLogicalForMonitor(state->monitor.lock());