diff options
author | vaxerski <[email protected]> | 2022-05-30 20:51:45 +0200 |
---|---|---|
committer | vaxerski <[email protected]> | 2022-05-30 20:51:45 +0200 |
commit | c9041bf5c993bfb5c67256ff20be7a025d97ffc5 (patch) | |
tree | c3bade167749219e485e94f02265cb85ec6b9c5d /src/helpers | |
parent | b2474d406a98b2d271107842074614975a469237 (diff) | |
download | Hyprland-c9041bf5c993bfb5c67256ff20be7a025d97ffc5.tar.gz Hyprland-c9041bf5c993bfb5c67256ff20be7a025d97ffc5.zip |
notify workspace protocol of workspace group change
Diffstat (limited to 'src/helpers')
-rw-r--r-- | src/helpers/Workspace.cpp | 22 | ||||
-rw-r--r-- | src/helpers/Workspace.hpp | 2 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/helpers/Workspace.cpp b/src/helpers/Workspace.cpp index 1b007319..d90d1391 100644 --- a/src/helpers/Workspace.cpp +++ b/src/helpers/Workspace.cpp @@ -77,4 +77,26 @@ void CWorkspace::setActive(bool on) { if (m_pWlrHandle) { 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()); }
\ No newline at end of file diff --git a/src/helpers/Workspace.hpp b/src/helpers/Workspace.hpp index a00126cb..2c1ac6d9 100644 --- a/src/helpers/Workspace.hpp +++ b/src/helpers/Workspace.hpp @@ -35,4 +35,6 @@ public: void startAnim(bool in, bool left, bool instant = false); void setActive(bool on); + + void moveToMonitor(const int&); };
\ No newline at end of file |