From ddfc44a788fd506c1ba487078ffd60455e8da658 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Tue, 23 Aug 2022 10:46:48 -0700 Subject: [PATCH] fix(wm): hard code unreal engine ws handling This commit introduces a temporary hard-coded fix for handling minimizing and restoration for UnrealEditor.exe when switching workspaces. re #211 --- komorebi/src/workspace.rs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/komorebi/src/workspace.rs b/komorebi/src/workspace.rs index 12ba6125..383b9b93 100644 --- a/komorebi/src/workspace.rs +++ b/komorebi/src/workspace.rs @@ -88,7 +88,15 @@ impl Workspace { pub fn hide(&mut self) { for container in self.containers_mut() { for window in container.windows_mut() { - window.hide(); + if let (Ok(exe), Ok(title)) = (window.exe(), window.title()) { + if exe == "UnrealEditor.exe" { + if title.ends_with(" - Unreal Editor") { + window.hide(); + } + } else { + window.hide(); + } + } } } @@ -112,7 +120,15 @@ impl Workspace { let mut to_focus = None; for (i, container) in self.containers_mut().iter_mut().enumerate() { if let Some(window) = container.focused_window_mut() { - window.restore(); + if let (Ok(exe), Ok(title)) = (window.exe(), window.title()) { + if exe == "UnrealEditor.exe" { + if title.ends_with(" - Unreal Editor") { + window.restore(); + } + } else { + window.restore(); + } + } if idx == i { to_focus = Option::from(*window);