summaryrefslogtreecommitdiff
path: root/src/events/Misc.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-02-01 00:55:17 +0000
committerVaxry <vaxry@vaxry.net>2024-02-01 00:55:29 +0000
commitcfd68af5b6c26f244838b628cf375b9cc0c5cfdf (patch)
tree7a8f1d5b3446af2a8321db52ee854e7ff4c0ba07 /src/events/Misc.cpp
parent4f804d5f962070c531dea5025e61be8a0da8129e (diff)
tearing-control: handle unmapped surfaces for hints
fixes #4570
Diffstat (limited to 'src/events/Misc.cpp')
-rw-r--r--src/events/Misc.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/events/Misc.cpp b/src/events/Misc.cpp
index d4f3a803..f2ff726b 100644
--- a/src/events/Misc.cpp
+++ b/src/events/Misc.cpp
@@ -233,14 +233,7 @@ void Events::listener_setCursorShape(wl_listener* listener, void* data) {
void Events::listener_newTearingHint(wl_listener* listener, void* data) {
const auto TCTL = (wlr_tearing_control_v1*)data;
- const auto PWINDOW = g_pCompositor->getWindowFromSurface(TCTL->surface);
-
- if (!PWINDOW) {
- Debug::log(ERR, "Tearing hint {} was attached to an unknown surface", (uintptr_t)data);
- return;
- }
-
- Debug::log(LOG, "New tearing hint for window {} at {}", PWINDOW, (uintptr_t)data);
+ Debug::log(LOG, "New tearing hint at {:x}", (uintptr_t)data);
const auto NEWCTRL = g_pHyprRenderer->m_vTearingControllers.emplace_back(std::make_unique<STearingController>()).get();
NEWCTRL->pWlrHint = (wlr_tearing_control_v1*)data;
@@ -248,7 +241,7 @@ void Events::listener_newTearingHint(wl_listener* listener, void* data) {
NEWCTRL->hyprListener_destroy.initCallback(
&NEWCTRL->pWlrHint->events.destroy,
[&](void* owner, void* data) {
- Debug::log(LOG, "Destroyed {} tearing hint", (uintptr_t)((STearingController*)owner)->pWlrHint);
+ Debug::log(LOG, "Destroyed {:x} tearing hint", (uintptr_t)((STearingController*)owner)->pWlrHint);
std::erase_if(g_pHyprRenderer->m_vTearingControllers, [&](const auto& other) { return other.get() == owner; });
},
@@ -264,7 +257,7 @@ void Events::listener_newTearingHint(wl_listener* listener, void* data) {
if (PWINDOW) {
PWINDOW->m_bTearingHint = (bool)TEARINGHINT->pWlrHint->current;
- Debug::log(LOG, "Hint {} (window {}) set tearing hint to {}", (uintptr_t)TEARINGHINT->pWlrHint, PWINDOW, (uint32_t)TEARINGHINT->pWlrHint->current);
+ Debug::log(LOG, "Hint {:x} (window {}) set tearing hint to {}", (uintptr_t)TEARINGHINT->pWlrHint, PWINDOW, (uint32_t)TEARINGHINT->pWlrHint->current);
}
},
NEWCTRL, "TearingController");