fix(wm): update target monitor after send op

This commit ensures that the focused workspace on the target monitor is
updated with the latest layout after it receives a window via the
send-to-monitor command.

resolve #37
This commit is contained in:
LGUG2Z
2021-09-15 07:18:07 -07:00
parent f1ee5ea194
commit 28a641609c
2 changed files with 5 additions and 2 deletions

4
Cargo.lock generated
View File

@@ -579,9 +579,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
[[package]]
name = "libc"
version = "0.2.101"
version = "0.2.102"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3cb00336871be5ed2c8ed44b60ae9959dc5b9f08539422ed43f09e34ecaeba21"
checksum = "a2a5ac8f984bfcf3a823267e5fde638acc3325f6496633a5da6bb6eb2171e103"
[[package]]
name = "lock_api"

View File

@@ -627,6 +627,8 @@ impl WindowManager {
pub fn move_container_to_monitor(&mut self, idx: usize, follow: bool) -> Result<()> {
tracing::info!("moving container");
let invisible_borders = self.invisible_borders;
let monitor = self
.focused_monitor_mut()
.ok_or_else(|| anyhow!("there is no monitor"))?;
@@ -651,6 +653,7 @@ impl WindowManager {
target_monitor.add_container(container)?;
target_monitor.load_focused_workspace()?;
target_monitor.update_focused_workspace(&invisible_borders)?;
if follow {
self.focus_monitor(idx)?;