mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
[PR #1154] [MERGED] fix(wm): move floats in direction across monitors #1226
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/LGUG2Z/komorebi/pull/1154
Author: @alex-ds13
Created: 11/28/2024
Status: ✅ Merged
Merged: 11/30/2024
Merged by: @LGUG2Z
Base:
master← Head:fix/move-in-direction-across-monitors📝 Commits (2)
8f4bc10fix(wm): move floats in direction across monitors3b20e4brefacor(wm): use helper function on move to workspace📊 Changes
3 files changed (+161 additions, -138 deletions)
View changed files
📝
komorebi/src/monitor.rs(+88 -48)📝
komorebi/src/process_command.rs(+31 -7)📝
komorebi/src/window_manager.rs(+42 -83)📄 Description
This commit fixes an issue where when trying to move floating windows or windows on a floating workspace across boundaries to another monitor using the
move_container_in_directionit wouldn't move the floating windows physically, although it moved them internally on komorebi, resulting in weird and wrong behavior.This commit creates a new method on
Monitortoadd_container_with_directionwhich takes a move direction and then uses the same logic that was previously on themove_container_in_directionfunction.It changes the
move_container_to_monitorfunction to take an optional move direction which if it is some will have this function call the new methodadd_container_with_directioninstead of justadd_container.Lastly the
move_container_in_directionfunction now when it realizes the move will be across monitors simply calls themove_container_to_monitorwith the direction that was initially given to it.These changes require that all callers of
move_container_to_monitoradd an direction option, instead of passingNoneon all of them, a new helper function was created, nameddirection_from_monitor_idxwhich calculates the direction a move will have from the currently focused monitor and the target monitor returnNoneif they are the same or returningSome(direction)if not. This way now all commands that call a move across monitor will use the logic to check from the direction if it should add the container on front or end.With these changes now all the code related to moving a window across monitors using a command should be on one place only making sure that in the future any change required only needs to be done on one place, instead of having to do it on
move_container_to_monitorandmove_container_in_directionas before!🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.