mirror of
https://github.com/hyprwm/Hyprland
synced 2025-02-17 03:22:31 +01:00
CCompositor::moveWindowToWorkspace -> CWindow::moveToWorkspace
This commit is contained in:
parent
0f25f3aee3
commit
f7f3446882
6 changed files with 15 additions and 18 deletions
|
@ -884,20 +884,6 @@ void CCompositor::moveWindowToTop(CWindow* pWindow) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCompositor::moveWindowToWorkspace(CWindow* pWindow, int workspaceID) {
|
|
||||||
if (!windowValidMapped(pWindow))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (pWindow->m_iWorkspaceID != workspaceID) {
|
|
||||||
pWindow->m_iWorkspaceID = workspaceID;
|
|
||||||
|
|
||||||
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(pWindow->m_iWorkspaceID);
|
|
||||||
if (PWORKSPACE) {
|
|
||||||
g_pEventManager->postEvent(SHyprIPCEvent{"movewindow", getFormat("%x,%s", pWindow, PWORKSPACE->m_szName.c_str())});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CCompositor::cleanupFadingOut(const int& monid) {
|
void CCompositor::cleanupFadingOut(const int& monid) {
|
||||||
for (auto& w : m_vWindowsFadingOut) {
|
for (auto& w : m_vWindowsFadingOut) {
|
||||||
|
|
||||||
|
|
|
@ -132,7 +132,6 @@ public:
|
||||||
bool doesSeatAcceptInput(wlr_surface*);
|
bool doesSeatAcceptInput(wlr_surface*);
|
||||||
bool isWindowActive(CWindow*);
|
bool isWindowActive(CWindow*);
|
||||||
void moveWindowToTop(CWindow*);
|
void moveWindowToTop(CWindow*);
|
||||||
void moveWindowToWorkspace(CWindow*, int);
|
|
||||||
void cleanupFadingOut(const int& monid);
|
void cleanupFadingOut(const int& monid);
|
||||||
CWindow* getWindowInDirection(CWindow*, char);
|
CWindow* getWindowInDirection(CWindow*, char);
|
||||||
void deactivateAllWLRWorkspaces(wlr_ext_workspace_handle_v1* exclude = nullptr);
|
void deactivateAllWLRWorkspaces(wlr_ext_workspace_handle_v1* exclude = nullptr);
|
||||||
|
|
|
@ -206,3 +206,14 @@ void CWindow::updateSurfaceOutputs() {
|
||||||
|
|
||||||
wlr_surface_for_each_surface(g_pXWaylandManager->getWindowSurface(this), sendEnterIter, PNEWMONITOR->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())});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -151,4 +151,5 @@ public:
|
||||||
void destroyToplevelHandle();
|
void destroyToplevelHandle();
|
||||||
void updateToplevel();
|
void updateToplevel();
|
||||||
void updateSurfaceOutputs();
|
void updateSurfaceOutputs();
|
||||||
|
void moveToWorkspace(int);
|
||||||
};
|
};
|
||||||
|
|
|
@ -206,7 +206,7 @@ void IHyprLayout::onMouseMove(const Vector2D& mousePos) {
|
||||||
|
|
||||||
if (PMONITOR) {
|
if (PMONITOR) {
|
||||||
DRAGGINGWINDOW->m_iMonitorID = PMONITOR->ID;
|
DRAGGINGWINDOW->m_iMonitorID = PMONITOR->ID;
|
||||||
g_pCompositor->moveWindowToWorkspace(DRAGGINGWINDOW, PMONITOR->activeWorkspace);
|
DRAGGINGWINDOW->moveToWorkspace(PMONITOR->activeWorkspace);
|
||||||
|
|
||||||
DRAGGINGWINDOW->updateToplevel();
|
DRAGGINGWINDOW->updateToplevel();
|
||||||
}
|
}
|
||||||
|
@ -231,7 +231,7 @@ void IHyprLayout::changeWindowFloatingMode(CWindow* pWindow) {
|
||||||
if (!TILED) {
|
if (!TILED) {
|
||||||
const auto PNEWMON = g_pCompositor->getMonitorFromVector(pWindow->m_vRealPosition.vec() + pWindow->m_vRealSize.vec() / 2.f);
|
const auto PNEWMON = g_pCompositor->getMonitorFromVector(pWindow->m_vRealPosition.vec() + pWindow->m_vRealSize.vec() / 2.f);
|
||||||
pWindow->m_iMonitorID = PNEWMON->ID;
|
pWindow->m_iMonitorID = PNEWMON->ID;
|
||||||
g_pCompositor->moveWindowToWorkspace(pWindow, PNEWMON->activeWorkspace);
|
pWindow->moveToWorkspace(PNEWMON->activeWorkspace);
|
||||||
|
|
||||||
// save real pos cuz the func applies the default 5,5 mid
|
// save real pos cuz the func applies the default 5,5 mid
|
||||||
const auto PSAVEDPOS = pWindow->m_vRealPosition.vec();
|
const auto PSAVEDPOS = pWindow->m_vRealPosition.vec();
|
||||||
|
|
|
@ -679,7 +679,7 @@ void CKeybindManager::moveActiveToWorkspace(std::string args) {
|
||||||
|
|
||||||
OLDWORKSPACE->m_bHasFullscreenWindow = false;
|
OLDWORKSPACE->m_bHasFullscreenWindow = false;
|
||||||
|
|
||||||
g_pCompositor->moveWindowToWorkspace(PWINDOW, PWORKSPACE->m_iID);
|
PWINDOW->moveToWorkspace(PWORKSPACE->m_iID);
|
||||||
PWINDOW->m_iMonitorID = PWORKSPACE->m_iMonitorID;
|
PWINDOW->m_iMonitorID = PWORKSPACE->m_iMonitorID;
|
||||||
PWINDOW->m_bIsFullscreen = false;
|
PWINDOW->m_bIsFullscreen = false;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue