mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-07 07:31:53 -07:00
groups: fix moving between displays
This commit is contained in:
@@ -271,17 +271,21 @@ void CWindow::updateSurfaceOutputs() {
|
||||
}
|
||||
|
||||
void CWindow::moveToWorkspace(int workspaceID) {
|
||||
if (m_iWorkspaceID != workspaceID) {
|
||||
m_iWorkspaceID = workspaceID;
|
||||
if (m_iWorkspaceID == workspaceID)
|
||||
return;
|
||||
|
||||
if (const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(m_iWorkspaceID); PWORKSPACE) {
|
||||
g_pEventManager->postEvent(SHyprIPCEvent{"movewindow", getFormat("%x,%s", this, PWORKSPACE->m_szName.c_str())});
|
||||
EMIT_HOOK_EVENT("moveWindow", (std::vector<void*>{this, PWORKSPACE}));
|
||||
}
|
||||
m_iWorkspaceID = workspaceID;
|
||||
|
||||
if (const auto PMONITOR = g_pCompositor->getMonitorFromID(m_iMonitorID); PMONITOR)
|
||||
g_pProtocolManager->m_pFractionalScaleProtocolManager->setPreferredScaleForSurface(g_pXWaylandManager->getWindowSurface(this), PMONITOR->scale);
|
||||
const auto PMONITOR = g_pCompositor->getMonitorFromID(m_iMonitorID);
|
||||
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(m_iWorkspaceID);
|
||||
|
||||
if (PWORKSPACE) {
|
||||
g_pEventManager->postEvent(SHyprIPCEvent{"movewindow", getFormat("%x,%s", this, PWORKSPACE->m_szName.c_str())});
|
||||
EMIT_HOOK_EVENT("moveWindow", (std::vector<void*>{this, PWORKSPACE}));
|
||||
}
|
||||
|
||||
if (PMONITOR)
|
||||
g_pProtocolManager->m_pFractionalScaleProtocolManager->setPreferredScaleForSurface(g_pXWaylandManager->getWindowSurface(this), PMONITOR->scale);
|
||||
}
|
||||
|
||||
CWindow* CWindow::X11TransientFor() {
|
||||
@@ -615,4 +619,21 @@ void CWindow::insertWindowToGroup(CWindow* pWindow) {
|
||||
pWindow->m_sGroupData.pNextWindow = PHEAD;
|
||||
|
||||
setGroupCurrent(pWindow);
|
||||
}
|
||||
|
||||
void CWindow::updateGroupOutputs() {
|
||||
if (!m_sGroupData.pNextWindow)
|
||||
return;
|
||||
|
||||
CWindow* curr = m_sGroupData.pNextWindow;
|
||||
|
||||
while (curr != this) {
|
||||
curr->m_iMonitorID = m_iMonitorID;
|
||||
curr->moveToWorkspace(m_iWorkspaceID);
|
||||
|
||||
curr->m_vRealPosition = m_vRealPosition.goalv();
|
||||
curr->m_vRealSize = m_vRealSize.goalv();
|
||||
|
||||
curr = curr->m_sGroupData.pNextWindow;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user