Skip to content

Commit

Permalink
change new V2 events to use szShortDescription
Browse files Browse the repository at this point in the history
  • Loading branch information
spikespaz committed Feb 8, 2024
1 parent 96d8508 commit 16987e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/Compositor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2023,10 +2023,10 @@ void CCompositor::swapActiveWorkspaces(CMonitor* pMonitorA, CMonitor* pMonitorB)

// event
g_pEventManager->postEvent(SHyprIPCEvent{"moveworkspace", std::format("{},{}", PWORKSPACEA->m_szName, pMonitorB->szName)});
g_pEventManager->postEvent(SHyprIPCEvent{"moveworkspacev2", std::format("{},{},{}", PWORKSPACEA->m_szName, pMonitorB->szName, pMonitorB->szDescription)});
g_pEventManager->postEvent(SHyprIPCEvent{"moveworkspacev2", std::format("{},{},{}", PWORKSPACEA->m_szName, pMonitorB->szName, pMonitorB->szShortDescription)});
EMIT_HOOK_EVENT("moveWorkspace", (std::vector<void*>{PWORKSPACEA, pMonitorB}));
g_pEventManager->postEvent(SHyprIPCEvent{"moveworkspace", std::format("{},{}", PWORKSPACEB->m_szName, pMonitorA->szName)});
g_pEventManager->postEvent(SHyprIPCEvent{"moveworkspacev2", std::format("{},{},{}", PWORKSPACEB->m_szName, pMonitorA->szName, pMonitorA->szDescription)});
g_pEventManager->postEvent(SHyprIPCEvent{"moveworkspacev2", std::format("{},{},{}", PWORKSPACEB->m_szName, pMonitorA->szName, pMonitorA->szShortDescription)});
EMIT_HOOK_EVENT("moveWorkspace", (std::vector<void*>{PWORKSPACEB, pMonitorA}));
}

Expand Down Expand Up @@ -2593,7 +2593,7 @@ void CCompositor::setActiveMonitor(CMonitor* pMonitor) {
const auto PWORKSPACE = getWorkspaceByID(pMonitor->activeWorkspace);

g_pEventManager->postEvent(SHyprIPCEvent{"focusedmon", std::format("{},{}", pMonitor->szName, PWORKSPACE->m_szName)});
g_pEventManager->postEvent(SHyprIPCEvent{"focusedmonv2", std::format("{},{},{}", pMonitor->szName, pMonitor->szDescription, PWORKSPACE->m_szName)});
g_pEventManager->postEvent(SHyprIPCEvent{"focusedmonv2", std::format("{},{},{}", pMonitor->szName, pMonitor->szShortDescription, PWORKSPACE->m_szName)});
EMIT_HOOK_EVENT("focusedMon", pMonitor);
m_pLastMonitor = pMonitor;
}
Expand Down
10 changes: 5 additions & 5 deletions src/helpers/Monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ void CMonitor::onConnect(bool noRule) {
//

g_pEventManager->postEvent(SHyprIPCEvent{"monitoradded", szName});
g_pEventManager->postEvent(SHyprIPCEvent{"monitoraddedv2", std::format("{},{}", szName, szDescription)});
g_pEventManager->postEvent(SHyprIPCEvent{"monitoraddedv2", std::format("{},{}", szName, szShortDescription)});
EMIT_HOOK_EVENT("monitorAdded", this);

if (!g_pCompositor->m_pLastMonitor) // set the last monitor if it isnt set yet
Expand Down Expand Up @@ -249,7 +249,7 @@ void CMonitor::onDisconnect(bool destroy) {
Debug::log(LOG, "Removed monitor {}!", szName);

g_pEventManager->postEvent(SHyprIPCEvent{"monitorremoved", szName});
g_pEventManager->postEvent(SHyprIPCEvent{"monitorremovedv2", std::format("{},{}", szName, szDescription)});
g_pEventManager->postEvent(SHyprIPCEvent{"monitorremovedv2", std::format("{},{}", szName, szShortDescription)});
EMIT_HOOK_EVENT("monitorRemoved", this);

if (!BACKUPMON) {
Expand Down Expand Up @@ -588,7 +588,7 @@ void CMonitor::setSpecialWorkspace(CWorkspace* const pWorkspace) {
if (const auto EXISTINGSPECIAL = g_pCompositor->getWorkspaceByID(specialWorkspaceID); EXISTINGSPECIAL) {
EXISTINGSPECIAL->startAnim(false, false);
g_pEventManager->postEvent(SHyprIPCEvent{"activespecial", std::format(",{}", szName)});
g_pEventManager->postEvent(SHyprIPCEvent{"activespecialv2", std::format(",{},{}", szName, szDescription)});
g_pEventManager->postEvent(SHyprIPCEvent{"activespecialv2", std::format(",{},{}", szName, szShortDescription)});
}
specialWorkspaceID = 0;

Expand Down Expand Up @@ -617,7 +617,7 @@ void CMonitor::setSpecialWorkspace(CWorkspace* const pWorkspace) {
PMONITORWORKSPACEOWNER->specialWorkspaceID = 0;
g_pLayoutManager->getCurrentLayout()->recalculateMonitor(PMONITORWORKSPACEOWNER->ID);
g_pEventManager->postEvent(SHyprIPCEvent{"activespecial", std::format(",{}", PMONITORWORKSPACEOWNER->szName)});
g_pEventManager->postEvent(SHyprIPCEvent{"activespecialv2", std::format(",{},{}", PMONITORWORKSPACEOWNER->szName, PMONITORWORKSPACEOWNER->szDescription)});
g_pEventManager->postEvent(SHyprIPCEvent{"activespecialv2", std::format(",{},{}", PMONITORWORKSPACEOWNER->szName, PMONITORWORKSPACEOWNER->szShortDescription)});
animate = false;
}

Expand Down Expand Up @@ -658,7 +658,7 @@ void CMonitor::setSpecialWorkspace(CWorkspace* const pWorkspace) {
g_pInputManager->refocus();

g_pEventManager->postEvent(SHyprIPCEvent{"activespecial", std::format("{},{}", pWorkspace->m_szName, szName)});
g_pEventManager->postEvent(SHyprIPCEvent{"activespecialv2", std::format("{},{},{}", pWorkspace->m_szName, szName, szDescription)});
g_pEventManager->postEvent(SHyprIPCEvent{"activespecialv2", std::format("{},{},{}", pWorkspace->m_szName, szName, szShortDescription)});

g_pHyprRenderer->damageMonitor(this);

Expand Down

0 comments on commit 16987e5

Please sign in to comment.