komorebi icon indicating copy to clipboard operation
komorebi copied to clipboard

[BUG]: Focus issue when switching workspaces

Open Lap1n opened this issue 2 years ago • 4 comments

Describe the bug Hi!

Using Unreal Engine and having a blueprint window (this could be considered as a popup window?) opened (the engine and the blue print window side by side), I am currently having issue switching workspaces. When I do, Komorebi tries to switch to the wanted one, but then immediately switch back to the current one. It will only work if I minimize/close the blueprint window.

I tried to add a float rule to the blueprint window, but unfortunately it has the same "class" (UnrealWindow) and "exe"(UnrealEditor.exe) names as the Editor itself. Only the "title" fields are different, but they are also specific to the project/assets being opened (it could work if the float rules supports regex expression I guess?) . The "hwnd" fields are not the same, but I think we cannot target by this field right?

Maybe I missed a configuration that could resolve this behaviour?

Great work by the way with this tiling window manager!

To Reproduce Steps to reproduce the behavior:

  1. Open Unreal engine (or possibly (not tested) any kind of app?)
  2. Open a blueprint window (or possibly (not tested) open another (popup?) window inside of an app? )
  3. Switch workspace
  4. Bug happen

Expected behavior We should be able to switch workspaces even when multiple windows from the same application are opened.

Operating System

OS Name:                   Microsoft Windows 11 Pro
OS Version:                10.0.22000 N/A Build 22000

Lap1n avatar Aug 19 '22 15:08 Lap1n

Thank you for the bug report! I will take a bit of time to install UE and figure out the software as I'm not very familiar with it.

In the meantime, when floating titles, it's possible to try and match on a prefix or a suffix string; it's not quite as powerful as full regex expressions, but it may be possible to target those blueprint windows if they share common prefixes or suffixes in their titles.

LGUG2Z avatar Aug 19 '22 16:08 LGUG2Z

I have installed Unreal Engine and I have been able to reproduce this with a popup window.

LGUG2Z avatar Aug 23 '22 15:08 LGUG2Z

I think I have an idea what may be causing this issue; when minimizing the "main" UE window, any popup windows are also automatically minimized as well. This is a very non-standard behaviour on Windows (child/popup windows should not be minimized when the parent window is) which will take some custom handling in komorebi to deal with gracefully. I will start brainstorming some possibles ways to handle this. 🤔

LGUG2Z avatar Aug 23 '22 15:08 LGUG2Z

@Lap1n there is a temporary fix available in the commit referenced above that I have tested myself. Hopefully I will be able to design a nicer way to keep this in user configuration instead of hard-coded in the process so that it can be used for other applications that may be found to behave like this in the future.

LGUG2Z avatar Aug 23 '22 17:08 LGUG2Z

@Lap1n Check out this commit, just set window-hiding-behaviour to cloak: https://github.com/LGUG2Z/komorebi/commit/80c98596dd2cb4e28666e49c753ffc7e5137e09e

LGUG2Z avatar Feb 11 '23 23:02 LGUG2Z