summaryrefslogtreecommitdiff
path: root/src/Window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Window.cpp')
-rw-r--r--src/Window.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Window.cpp b/src/Window.cpp
index 926d2da6..e9af0349 100644
--- a/src/Window.cpp
+++ b/src/Window.cpp
@@ -205,4 +205,15 @@ void CWindow::updateSurfaceOutputs() {
wlr_surface_for_each_surface(g_pXWaylandManager->getWindowSurface(this), sendLeaveIter, PLASTMONITOR->output);
wlr_surface_for_each_surface(g_pXWaylandManager->getWindowSurface(this), sendEnterIter, PNEWMONITOR->output);
+}
+
+void CWindow::moveToWorkspace(int workspaceID) {
+ if (m_iWorkspaceID != workspaceID) {
+ m_iWorkspaceID = workspaceID;
+
+ const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(m_iWorkspaceID);
+ if (PWORKSPACE) {
+ g_pEventManager->postEvent(SHyprIPCEvent{"movewindow", getFormat("%x,%s", this, PWORKSPACE->m_szName.c_str())});
+ }
+ }
} \ No newline at end of file