mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-03 21:51:55 -07:00
notify workspace protocol of workspace group change
This commit is contained in:
@@ -997,6 +997,7 @@ void CCompositor::moveWorkspaceToMonitor(CWorkspace* pWorkspace, SMonitor* pMoni
|
|||||||
// move the workspace
|
// move the workspace
|
||||||
|
|
||||||
pWorkspace->m_iMonitorID = pMonitor->ID;
|
pWorkspace->m_iMonitorID = pMonitor->ID;
|
||||||
|
pWorkspace->moveToMonitor(pMonitor->ID);
|
||||||
|
|
||||||
for (auto& w : m_lWindows) {
|
for (auto& w : m_lWindows) {
|
||||||
if (w.m_iWorkspaceID == pWorkspace->m_iID)
|
if (w.m_iWorkspaceID == pWorkspace->m_iID)
|
||||||
|
@@ -78,3 +78,25 @@ void CWorkspace::setActive(bool on) {
|
|||||||
wlr_ext_workspace_handle_v1_set_active(m_pWlrHandle, on);
|
wlr_ext_workspace_handle_v1_set_active(m_pWlrHandle, on);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CWorkspace::moveToMonitor(const int& id) {
|
||||||
|
const auto PMONITOR = g_pCompositor->getMonitorFromID(id);
|
||||||
|
|
||||||
|
if (!PMONITOR)
|
||||||
|
return;
|
||||||
|
|
||||||
|
wlr_ext_workspace_handle_v1_set_active(m_pWlrHandle, false);
|
||||||
|
wlr_ext_workspace_handle_v1_destroy(m_pWlrHandle);
|
||||||
|
|
||||||
|
m_pWlrHandle = wlr_ext_workspace_handle_v1_create(PMONITOR->pWLRWorkspaceGroupHandle);
|
||||||
|
|
||||||
|
// set geometry here cuz we can
|
||||||
|
wl_array_init(&m_wlrCoordinateArr);
|
||||||
|
*reinterpret_cast<int*>(wl_array_add(&m_wlrCoordinateArr, sizeof(int))) = (int)PMONITOR->vecPosition.x;
|
||||||
|
*reinterpret_cast<int*>(wl_array_add(&m_wlrCoordinateArr, sizeof(int))) = (int)PMONITOR->vecPosition.y;
|
||||||
|
wlr_ext_workspace_handle_v1_set_coordinates(m_pWlrHandle, &m_wlrCoordinateArr);
|
||||||
|
wlr_ext_workspace_handle_v1_set_hidden(m_pWlrHandle, false);
|
||||||
|
wlr_ext_workspace_handle_v1_set_urgent(m_pWlrHandle, false);
|
||||||
|
|
||||||
|
wlr_ext_workspace_handle_v1_set_name(m_pWlrHandle, m_szName.c_str());
|
||||||
|
}
|
@@ -35,4 +35,6 @@ public:
|
|||||||
|
|
||||||
void startAnim(bool in, bool left, bool instant = false);
|
void startAnim(bool in, bool left, bool instant = false);
|
||||||
void setActive(bool on);
|
void setActive(bool on);
|
||||||
|
|
||||||
|
void moveToMonitor(const int&);
|
||||||
};
|
};
|
Reference in New Issue
Block a user