diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index 660b08a2..ba2a5942 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -295,6 +295,8 @@ void Events::listener_mapWindow(void* owner, void* data) { const auto TIMER = wl_event_loop_add_timer(g_pCompositor->m_sWLEventLoop, setAnimToMove, PWINDOW); wl_event_source_timer_update(TIMER, PWINDOW->m_vRealPosition.getDurationLeftMs() + 5); + g_pEventManager->postEvent(SHyprIPCEvent{"mapwindow", getFormat("%x,%s,%s,%s", PWINDOW, PWORKSPACE->m_szName.c_str(), g_pXWaylandManager->getAppIDClass(PWINDOW).c_str(), PWINDOW->m_szTitle.c_str())}); + if (workspaceSilent) { // move the window if (g_pCompositor->m_pLastWindow == PWINDOW) { @@ -335,6 +337,7 @@ void Events::listener_unmapWindow(void* owner, void* data) { CWindow* PWINDOW = (CWindow*)owner; Debug::log(LOG, "Window %x unmapped (class %s)", PWINDOW, g_pXWaylandManager->getAppIDClass(PWINDOW).c_str()); + g_pEventManager->postEvent(SHyprIPCEvent{"unmapwindow", getFormat("%x", PWINDOW)}); if (!PWINDOW->m_bIsX11) { Debug::log(LOG, "Unregistered late callbacks XDG"); diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp index 4a3f1800..173668bc 100644 --- a/src/layout/IHyprLayout.cpp +++ b/src/layout/IHyprLayout.cpp @@ -206,8 +206,16 @@ void IHyprLayout::onMouseMove(const Vector2D& mousePos) { if (PMONITOR) { DRAGGINGWINDOW->m_iMonitorID = PMONITOR->ID; - DRAGGINGWINDOW->m_iWorkspaceID = PMONITOR->activeWorkspace; + + if (DRAGGINGWINDOW->m_iWorkspaceID != PMONITOR->activeWorkspace) { + DRAGGINGWINDOW->m_iWorkspaceID = PMONITOR->activeWorkspace; + auto PWORKSPACE = g_pCompositor->getWorkspaceByID(DRAGGINGWINDOW->m_iWorkspaceID); + if (PWORKSPACE) { + g_pEventManager->postEvent(SHyprIPCEvent{"movewindow", getFormat("%x,%s", DRAGGINGWINDOW, PWORKSPACE->m_szName.c_str())}); + } + } + DRAGGINGWINDOW->updateToplevel(); } diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 9939993a..c17886ff 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -670,6 +670,8 @@ void CKeybindManager::moveActiveToWorkspace(std::string args) { g_pInputManager->refocus(); PWINDOW->updateToplevel(); + + g_pEventManager->postEvent(SHyprIPCEvent{"movewindow", getFormat("%x,%s", PWINDOW, PWORKSPACE->m_szName.c_str())}); } void CKeybindManager::moveActiveToWorkspaceSilent(std::string args) {