events: ignore setTitle when title didn't change

This commit is contained in:
Vaxry 2024-03-13 15:38:18 +00:00
parent 893c55217b
commit 3e67ee0f5f

View file

@ -901,7 +901,12 @@ void Events::listener_setTitleWindow(void* owner, void* data) {
if (!g_pCompositor->windowValidMapped(PWINDOW)) if (!g_pCompositor->windowValidMapped(PWINDOW))
return; 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)}); g_pEventManager->postEvent(SHyprIPCEvent{"windowtitle", std::format("{:x}", (uintptr_t)PWINDOW)});
EMIT_HOOK_EVENT("windowTitle", PWINDOW); EMIT_HOOK_EVENT("windowTitle", PWINDOW);