From 3e67ee0f5f66c74c0a0bd4f797361fd100c2e2d2 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Wed, 13 Mar 2024 15:38:18 +0000 Subject: [PATCH] events: ignore setTitle when title didn't change --- src/events/Windows.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index 2da54583..1e547efc 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -901,7 +901,12 @@ void Events::listener_setTitleWindow(void* owner, void* data) { if (!g_pCompositor->windowValidMapped(PWINDOW)) return; - PWINDOW->m_szTitle = g_pXWaylandManager->getTitle(PWINDOW); + const auto NEWTITLE = g_pXWaylandManager->getTitle(PWINDOW); + + if (NEWTITLE == PWINDOW->m_szTitle) + return; + + PWINDOW->m_szTitle = NEWTITLE; g_pEventManager->postEvent(SHyprIPCEvent{"windowtitle", std::format("{:x}", (uintptr_t)PWINDOW)}); EMIT_HOOK_EVENT("windowTitle", PWINDOW);