mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-08 23:06:01 +01:00
Add mapwindow, unmapwindow and movewindow IPC events
This commit is contained in:
parent
4c1dba643e
commit
844c33c980
3 changed files with 14 additions and 1 deletions
|
@ -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");
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue