feat: add ipc set title window event (#2419)

* feat: add ipc set title window event

* chore: add EMIT_HOOK_EVENT and change event name
This commit is contained in:
Cyril Levis 2023-06-03 11:18:49 +02:00 committed by GitHub
parent 67be8d89b5
commit d7db7040d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -805,6 +805,8 @@ void Events::listener_setTitleWindow(void* owner, void* data) {
return;
PWINDOW->m_szTitle = g_pXWaylandManager->getTitle(PWINDOW);
g_pEventManager->postEvent(SHyprIPCEvent{"windowtitle", getFormat("%lx", PWINDOW)});
EMIT_HOOK_EVENT("windowTitle", PWINDOW);
if (PWINDOW == g_pCompositor->m_pLastWindow) { // if it's the active, let's post an event to update others
g_pEventManager->postEvent(SHyprIPCEvent{"activewindow", g_pXWaylandManager->getAppIDClass(PWINDOW) + "," + PWINDOW->m_szTitle});