mirror of
https://github.com/hyprwm/Hyprland.git
synced 2026-09-27 17:36:01 -04:00
monitor: move floating windows with layout changes (#14928)
Co-authored-by: Pppp1116 <pcaiadoguerreiro@gmail.com>
This commit is contained in:
@@ -1676,7 +1676,24 @@ void CMonitor::setSpecialWorkspace(const WORKSPACEID& id) {
|
||||
}
|
||||
|
||||
void CMonitor::moveTo(const Vector2D& pos) {
|
||||
if (m_position == pos)
|
||||
return;
|
||||
|
||||
const auto OLD_POSITION = m_position;
|
||||
|
||||
m_position = pos;
|
||||
|
||||
if (OLD_POSITION == Vector2D{-1, -1})
|
||||
return;
|
||||
|
||||
const auto DELTA = pos - OLD_POSITION;
|
||||
|
||||
for (const auto& w : g_pCompositor->m_windows) {
|
||||
if (!validMapped(w) || !w->m_isFloating || w->m_monitor != m_self)
|
||||
continue;
|
||||
|
||||
w->layoutTarget()->setPositionGlobal(w->layoutTarget()->position().translate(DELTA));
|
||||
}
|
||||
}
|
||||
|
||||
Vector2D CMonitor::middle() {
|
||||
|
||||
Reference in New Issue
Block a user