LGUG2Z / komorebi

A tiling window manager for Windows 🍉
https://lgug2z.github.io/komorebi/
Other
9.59k stars 198 forks source link

[BUG]: Revit and Rhino don't tile #726

Closed pjhfggij closed 3 months ago

pjhfggij commented 7 months ago

Describe the bug Neither Autodesk Revit nor McNeel Rhino get picked up by komorebi. They don't tile, clicking on their windows doesn't make komorebi's shortcuts to modify them (toggle tile command for example toggles the previously focused window) and they don't show up in the komorebic state output.

To Reproduce Steps to reproduce the behavior:

  1. Start either Autodesk Revit or McNeel Rhino (both require a paid licence although Rhino has a free trial)
  2. See bug

Expected behavior Both of them should tile like other programs (e.g. Autodesk AutoCAD and Trimble Sketchup both tile correctly).

Operating System

OS Name:                   Microsoft Windows 10
OS Version:                10.0.19045 Build 19045 

It's a virtual machine with GPU passthrough.

komorebic check Output

No KOMOREBI_CONFIG_HOME detected, defaulting to C:\Users\<USER>

Looking for configuration files in C:\Users\<USER>

Found komorebi.json; this file can be passed to the start command with the --config flag

Found C:\Users\<USER>\.config\whkdrc; key bindings will be loaded from here when whkd is started, and you can start it automatically using the --whkd flag
moukle commented 6 months ago

I have the same bug with Godot :(

When focusing the app the cursor is completely broken: always returns to centre on click and very laggy.

manage_rules

I tried many different manage_rules but none helps:

   {
      "kind": "Title",
      "id": "Godot Engine",
      "matching_strategy": "Equals"
    },
    { 
      "kind": "Title",
      "id": "Godot Engine",
      "matching_strategy": "StartsWith"
    },
    { 
      "kind": "Path",
      "id": "C:\\Godot\\",
      "matching_strategy": "StartsWith"
    },
    { 
      "kind": "Exe",
      "id": "Godot_v4.2.2-stable_win64.exe",
      "matching_strategy": "Equals"
    },
    { 
      "kind": "Exe",
      "id": "Godot_*.exe",
      "matching_strategy": "StartsWith"
    }

Versions

Edition       Windows 11 Education
Version       23H2
OS build      22631.3447
$ komorebi.exe --version
komorebi 0.1.25

Switching to pwsh also didn't help.

LGUG2Z commented 6 months ago

Godot I was able to try out myself; I noticed that it tiles correctly without any additional rules if you minimize it and then restore it, which suggests that it probably isn't sending the signals to the OS that a Windows app is supposed to when it starts up. Thankfully most apps like this send ObjectNameChange when they launch, so adding this makes it tile on first launch:

  "object_name_change_applications": [
    {
      "kind": "Class",
      "id": "Engine",
      "matching_strategy": "Equals"
    }
  ],

You can also match by the Exe if you want to

moukle commented 6 months ago

It works! Thank you for your fast investigations! 😄🙏

Small issue: Godot flickers on refocus

LGUG2Z commented 6 months ago

Flickering for a number of apps has been fixed on the master branch for a little bit now

LGUG2Z commented 6 months ago

@pjhfggij are you able to try the same sort of fix for Revit and Rhino? 👀

pjhfggij commented 3 months ago

sorry, I know I should have properly gone through documentation, but I'm getting stuck on too many parts right now and don't want to yield incorrect results. Where do you place "object_name_change_applications". Is it in komorebi.json or applications.json. Where do they need to be located? Is it %USERPROFILE% or %USERPROFILE%/.config or %USERPROFILE%/.config/komorebi? In your video (How to Set a Custom Config Directory in Komorebi) you are taking many more steps to configure environment variables and powershell execution policy. I assume it isn't necessary just to test it in this case? I haven't configured komorebi yet in any way, just run komorebi start --whkd.

azinsharaf commented 3 months ago

adding "object_name_change_applications" fixed the issue i had with Devolutions Remote Desktop Manager for a year!

LGUG2Z commented 3 months ago

@pjhfggij running komorebic config in a terminal will print the path to your komorebi.json file - this is where you can add "object_name_change_applications" at the top level of the JSON object

If you are just running komorebic start --whkd I'm guessing you downloaded the example configuration to your USERPROFILE directory if you followed the quickstart - if that's working for you there is no need to set a custom config directory or anything like that.

pjhfggij commented 3 months ago

thank you @LGUG2Z, that's helpful. I'll give it a try

pjhfggij commented 3 months ago

@LGUG2Z thanks, komorebic config got me going and as you said "object_name_change_applications" solves it:

image

shoved this into C:\Users\user\komorebi.json (result of komorebic config)

{
  "$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.22/schema.json",
  "app_specific_configuration_path": "$Env:USERPROFILE/applications.yaml",
  "window_hiding_behaviour": "Cloak",
  "cross_monitor_move_behaviour": "Insert",
  "default_workspace_padding": 2,
  "default_container_padding": 2,
  "border_padding": 1,
  "border_offset": -1,
  "active_window_border": true,
  "active_window_border_width": 4,
  "object_name_change_applications": [
    {
      "kind": "Exe",
      "id": "Revit.exe",
      "matching_strategy": "Equals"
    }
  ],
  "active_window_border_colours": {
    "single": "#50c8fc",
    "stack": "#00a542",
    "monocle": "#ff3399"
  },
  "monitors": [
    {
      "workspaces": [
        { "name": "I", "layout": "BSP" },
        { "name": "II", "layout": "VerticalStack" },
        { "name": "III", "layout": "HorizontalStack" },
        { "name": "IV", "layout": "UltrawideVerticalStack" },
        { "name": "V", "layout": "Rows" }
      ]
    }
  ]
}

if you saw my previous message for a brief moment, I've initially missed a quote in config (love those quirks of editing json in notepad.exe)

LGUG2Z commented 3 months ago

Glad that this was finally resolved!

pjhfggij commented 3 months ago

sorry @LGUG2Z not quite yet, while Revit.exe works fine, Rhino.exe doesn't

perhaps I'm not matching it correctly (I'm sure though executable name is Rhino.exe) is it documented anywhere how to find Class instead of Exe name of a program?

{
  "$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.22/schema.json",
  "app_specific_configuration_path": "$Env:USERPROFILE/applications.yaml",
  "window_hiding_behaviour": "Cloak",
  "cross_monitor_move_behaviour": "Insert",
  "default_workspace_padding": 2,
  "default_container_padding": 2,
  "border_padding": 1,
  "border_offset": -1,
  "active_window_border": true,
  "active_window_border_width": 4,
  "object_name_change_applications": [
    {
      "kind": "Exe",
      "id": "Revit.exe",
      "matching_strategy": "Equals"
    },
    {
      "kind": "Exe",
      "id": "Rhino.exe",
      "matching_strategy": "Equals"
    }
  ],
  "active_window_border_colours": {
    "single": "#50c8fc",
    "stack": "#00a542",
    "monocle": "#ff3399"
  },
  "monitors": [
    {
      "workspaces": [
        { "name": "I", "layout": "BSP" },
        { "name": "II", "layout": "VerticalStack" },
        { "name": "III", "layout": "HorizontalStack" },
        { "name": "IV", "layout": "UltrawideVerticalStack" },
        { "name": "V", "layout": "Rows" }
      ]
    }
  ]
}

image

LGUG2Z commented 3 months ago

You can run komorebic gui to launch the debug GUI and in the top section there is dropdown where you can select any window on the screen and get information about it including the class name - you can check out the timestamped part of this video for an example: https://youtu.be/Yt-sFaq3nJA?si=tMp5pwgRBJ1WiMd6&t=2070

pjhfggij commented 3 months ago

was komorebic gui subcommand added after version 0.1.22? Running it on 0.1.22 results in error:

>komorebic gui
error: unrecognized subcommand 'gui'
LGUG2Z commented 3 months ago

Ah yes, it was added in v0.1.26 - it may be time to upgrade! 😆

pjhfggij commented 3 months ago

true, after upgrade to latest 0.1.28 version Rhino worked as well - I think this closes the issue then. Config from above unchanged:

  "object_name_change_applications": [
    {
      "kind": "Exe",
      "id": "Revit.exe",
      "matching_strategy": "Equals"
    },
    {
      "kind": "Exe",
      "id": "Rhino.exe",
      "matching_strategy": "Equals"
    }
  ],

image

While it works, I'm encountering this bug where sometimes opening Rhino resizes the window by half multiple times until it disappeared in right bottom corner (grey rectangle remnants of its border) and Rhino window become just a "stub": image

image

Also, by the way this is a Rhino-specific issue, but it keeps closing it's subwindow (window in focus in the middle) when Rhino is not in focus, same behavior can be observed when run via wine on linux (KDE). I wonder if there is some way to prevent that.

image

Also noticed that some windows (project browser) in Revit still don't tile. It's not important for my workflow, but maybe others may want to investigate it further. UIViews worked fine (which for me was more important).

LGUG2Z commented 3 months ago

Can you try removing the object name change block from the config?

I think that this change to make style parsing more lenient may fix your initial issue, whereas emitting events when the window title changes may be causing some of the new issues you are reporting 🤔