LGUG2Z / komorebi

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

[FEAT]: Ignore MDI Child #433

Closed brccabral closed 5 months ago

brccabral commented 1 year ago

Is your feature request related to a problem? Please describe. Some applications create child windows, I guess they are called MDI Child.
https://learn.microsoft.com/en-us/cpp/mfc/managing-mdi-child-windows?view=msvc-170
https://docs.wxwidgets.org/3.0/classwx_m_d_i_child_frame.html
When this happens komorebi thinks that there are 2 windows, not 1, and it resizes both Parent and Child windows, creating an empty space and it becomes almost impossible to work with such application (in my case, "Microsoft Visual Basic for Applications" - VBA for Excel).

Describe the solution you'd like I know that there is some setting to ignore some applications, but this ignores the entire application or I could not setup it correctly. I think that if komorebi could detect if it is a MDI Child we wouldn't need special configs.

Describe alternatives you've considered I tried the ignore config, but it didn't work

Additional context There is another internal tool that I use for work that uses MDI Child and with komorebi managing MDI Childs it becomes unusable for me. But I use it in my personal computer, if it could detect MDI Child it would be awesome!

LGUG2Z commented 1 year ago

Can you post the output of komorebic state when you are experiencing the ghost tiles?

brccabral commented 1 year ago

❯ komorebic state

{
  "monitors": {
    "elements": [
      {
        "id": 262275,
        "name": "DISPLAY1",
        "size": {
          "left": 0,
          "top": 0,
          "right": 1920,
          "bottom": 1080
        },
        "work_area_size": {
          "left": 0,
          "top": 0,
          "right": 1920,
          "bottom": 1040
        },
        "work_area_offset": null,
        "workspaces": {
          "elements": [
            {
              "name": "I",
              "containers": {
                "elements": [
                  {
                    "windows": {
                      "elements": [
                        {
                          "hwnd": 330192,
                          "title": "Excel",
                          "exe": "EXCEL.EXE",
                          "class": "XLMAIN",
                          "rect": {
                            "left": 40,
                            "top": 40,
                            "right": 900,
                            "bottom": 960
                          }
                        }
                      ],
                      "focused": 0
                    }
                  },
                  {
                    "windows": {
                      "elements": [
                        {
                          "hwnd": 3609452,
                          "title": "Command Prompt - komorebic  state",
                          "exe": "WindowsTerminal.exe",
                          "class": "CASCADIA_HOSTING_WINDOW_CLASS",
                          "rect": {
                            "left": 973,
                            "top": 40,
                            "right": 914,
                            "bottom": 967
                          }
                        }
                      ],
                      "focused": 0
                    }
                  }
                ],
                "focused": 1
              },
              "monocle_container": null,
              "maximized_window": null,
              "floating_windows": [],
              "layout": {
                "Default": "BSP"
              },
              "layout_rules": [],
              "layout_flip": null,
              "workspace_padding": 20,
              "container_padding": 20,
              "resize_dimensions": [
                null,
                null
              ],
              "tile": true
            },
            {
              "name": "II",
              "containers": {
                "elements": [],
                "focused": 0
              },
              "monocle_container": null,
              "maximized_window": null,
              "floating_windows": [],
              "layout": {
                "Default": "BSP"
              },
              "layout_rules": [],
              "layout_flip": null,
              "workspace_padding": 10,
              "container_padding": 10,
              "resize_dimensions": [],
              "tile": true
            },
            {
              "name": "III",
              "containers": {
                "elements": [],
                "focused": 0
              },
              "monocle_container": null,
              "maximized_window": null,
              "floating_windows": [],
              "layout": {
                "Default": "BSP"
              },
              "layout_rules": [],
              "layout_flip": null,
              "workspace_padding": 10,
              "container_padding": 10,
              "resize_dimensions": [],
              "tile": true
            },
            {
              "name": "IV",
              "containers": {
                "elements": [],
                "focused": 0
              },
              "monocle_container": null,
              "maximized_window": null,
              "floating_windows": [],
              "layout": {
                "Default": "BSP"
              },
              "layout_rules": [],
              "layout_flip": null,
              "workspace_padding": 10,
              "container_padding": 10,
              "resize_dimensions": [],
              "tile": true
            },
            {
              "name": "V",
              "containers": {
                "elements": [],
                "focused": 0
              },
              "monocle_container": null,
              "maximized_window": null,
              "floating_windows": [],
              "layout": {
                "Default": "BSP"
              },
              "layout_rules": [],
              "layout_flip": null,
              "workspace_padding": 10,
              "container_padding": 10,
              "resize_dimensions": [],
              "tile": true
            }
          ],
          "focused": 0
        }
      },
      {
        "id": 852085,
        "name": "DISPLAY12",
        "size": {
          "left": -1003,
          "top": -1096,
          "right": 1920,
          "bottom": 1080
        },
        "work_area_size": {
          "left": -1003,
          "top": -1096,
          "right": 1920,
          "bottom": 1040
        },
        "work_area_offset": null,
        "workspaces": {
          "elements": [
            {
              "name": null,
              "containers": {
                "elements": [],
                "focused": 0
              },
              "monocle_container": null,
              "maximized_window": null,
              "floating_windows": [],
              "layout": {
                "Default": "BSP"
              },
              "layout_rules": [],
              "layout_flip": null,
              "workspace_padding": 10,
              "container_padding": 10,
              "resize_dimensions": [],
              "tile": true
            },
            {
              "name": null,
              "containers": {
                "elements": [
                  {
                    "windows": {
                      "elements": [
                        {
                          "hwnd": 723566,
                          "title": "5G Flex Light - 05162023_203401 5392598.xlsm - ACT (Code)",
                          "exe": "EXCEL.EXE",
                          "class": "VbaWindow",
                          "rect": {
                            "left": -1608,
                            "top": -2064,
                            "right": 930,
                            "bottom": 1000
                          }
                        }
                      ],
                      "focused": 0
                    }
                  },
                  {
                    "windows": {
                      "elements": [
                        {
                          "hwnd": 592310,
                          "title": "5G Flex Light - 05162023_203401 5392598.xlsm - DeleteMaps (Code)",
                          "exe": "EXCEL.EXE",
                          "class": "VbaWindow",
                          "rect": {
                            "left": -658,
                            "top": -2064,
                            "right": 930,
                            "bottom": 1000
                          }
                        }
                      ],
                      "focused": 0
                    }
                  }
                ],
                "focused": 1
              },
              "monocle_container": null,
              "maximized_window": null,
              "floating_windows": [
                {
                  "hwnd": 853558,
                  "title": "Microsoft Visual Basic for Applications - 5G Flex Light - 05162023_203401 5392598.xlsm",
                  "exe": "EXCEL.EXE",
                  "class": "wndclass_desked_gsk",
                  "rect": {
                    "left": -910,
                    "top": -1072,
                    "right": 1531,
                    "bottom": 882
                  }
                }
              ],
              "layout": {
                "Default": "BSP"
              },
              "layout_rules": [],
              "layout_flip": null,
              "workspace_padding": 10,
              "container_padding": 10,
              "resize_dimensions": [
                null,
                null
              ],
              "tile": true
            }
          ],
          "focused": 1
        }
      },
      {
        "id": 27985449,
        "name": "DISPLAY13",
        "size": {
          "left": 917,
          "top": -1080,
          "right": 1920,
          "bottom": 1080
        },
        "work_area_size": {
          "left": 917,
          "top": -1080,
          "right": 1920,
          "bottom": 1040
        },
        "work_area_offset": null,
        "workspaces": {
          "elements": [
            {
              "name": null,
              "containers": {
                "elements": [
                  {
                    "windows": {
                      "elements": [
                        {
                          "hwnd": 791470,
                          "title": "5G Flex Light - 05162023_203401 5392598.xlsm - Excel",
                          "exe": "EXCEL.EXE",
                          "class": "XLMAIN",
                          "rect": {
                            "left": 937,
                            "top": -1060,
                            "right": 1880,
                            "bottom": 1000
                          }
                        }
                      ],
                      "focused": 0
                    }
                  }
                ],
                "focused": 0
              },
              "monocle_container": null,
              "maximized_window": null,
              "floating_windows": [],
              "layout": {
                "Default": "BSP"
              },
              "layout_rules": [],
              "layout_flip": null,
              "workspace_padding": 10,
              "container_padding": 10,
              "resize_dimensions": [
                null
              ],
              "tile": true
            }
          ],
          "focused": 0
        }
      }
    ],
    "focused": 0
  },
  "is_paused": false,
  "invisible_borders": {
    "left": 7,
    "top": 0,
    "right": 14,
    "bottom": 7
  },
  "resize_delta": 50,
  "new_window_behaviour": "Create",
  "cross_monitor_move_behaviour": "Insert",
  "work_area_offset": null,
  "focus_follows_mouse": null,
  "mouse_follows_focus": true,
  "has_pending_raise_op": false,
  "float_identifiers": [
    "OPContainerClass",
    "IHWindowClass",
    "1Password.exe",
    "AbletonVstPlugClass",
    "Vst3PlugWindow",
    "Window Spy",
    "Bloxstrap.exe",
    "Calculator",
    "CredentialUIBroker.exe",
    "TApplication",
    "TWizardForm",
    "Dropbox.exe",
    "Elephicon.exe",
    "Camera Hub.exe",
    "ControlCenter.exe",
    "WaveLink.exe",
    "Chrome_RenderWidgetHostHWND",
    "SunAwtDialog",
    "keyviz.exe",
    "LogiBolt.exe",
    "LogiTune.exe",
    "LogiOptionsUI.exe",
    "_WwB",
    "MSPCManager.exe",
    "Microsoft Teams Notification",
    "Microsoft Teams Call",
    "MozillaTaskbarPreviewClass",
    "NohBoard.exe",
    "Paradox Launcher.exe",
    "PowerToys.ColorPickerUI.exe",
    "PowerToys.ImageResizer.exe",
    "ProcessHacker.exe",
    "QuickLook.exe",
    "RepoZ.exe",
    "RoundedTB.exe",
    "sideloadly.exe",
    "obj_App",
    "obj_Form",
    "SystemInformer.exe",
    "Shell_Dialog",
    "TaskManagerWindow",
    "tcconfig.exe",
    "TranslucentTB.exe",
    "winzip32.exe",
    "winzip64.exe",
    "OperationStatusWindow",
    "Control Panel",
    "msiexec.exe",
    "Hotkey sink",
    "Zoom.exe",
    "paintdotnet.exe",
    "pinentry.exe",
    "ueli.exe"
  ],
  "manage_identifiers": [
    "GalaxyClient.exe",
    "GodotManager.exe",
    "nhm_app.exe",
    "Obsidian.exe",
    "Slack.exe",
    "slack.exe",
    "ConsoleWindowClass"
  ],
  "layered_whitelist": [
    "steam.exe",
    "EXCEL.EXE",
    "OUTLOOK.EXE",
    "POWERPNT.EXE",
    "WINWORD.EXE"
  ],
  "tray_and_multi_window_identifiers": [
    "explorer.exe",
    "firefox.exe",
    "chrome.exe",
    "idea64.exe",
    "ApplicationFrameHost.exe",
    "steam.exe",
    "CreativeCloudDesktopWindowClass",
    "ArmCord.exe",
    "AutoHotkeyU64.exe",
    "Beeper.exe",
    "Bitwarden.exe",
    "Cron.exe",
    "Discord.exe",
    "DiscordCanary.exe",
    "DiscordDevelopment.exe",
    "DiscordPTB.exe",
    "ElectronMail.exe",
    "Element.exe",
    "ElevenClock.exe",
    "EpicGamesLauncher.exe",
    "GalaxyClient.exe",
    "GoPro Webcam",
    "GoogleDriveFS.exe",
    "itch.exe",
    "kleopatra.exe",
    "Kotatogram.exe",
    "localsend_app.exe",
    "LogiTune.exe",
    "lghub.exe",
    "mailspring.exe",
    "ManyCam.exe",
    "OUTLOOK.EXE",
    "ModernFlyoutsHost.exe",
    "Notion Enhanced.exe",
    "obs32.exe",
    "obs64.exe",
    "DocEditorsWindowClass",
    "OpenRGB.exe",
    "ProcessHacker.exe",
    "ProtonVPN.exe",
    "pycharm64.exe",
    "QtScrcpy.exe",
    "rider64.exe",
    "rbxfpsunlocker.exe",
    "RoundedTB.exe",
    "ShareX.exe",
    "signal.exe",
    "sirikali.exe",
    "Slack.exe",
    "slack.exe",
    "SoulseekQt.exe",
    "Spotify.exe",
    "stremio.exe",
    "SystemInformer.exe",
    "Telegram.exe",
    "tcconfig.exe",
    "TranslucentTB.exe",
    "UnrealEditor.exe",
    "VRCX.exe",
    "VoiceAI.exe",
    "WebTorrent.exe",
    "WingetUI.exe",
    "wingetui.exe",
    "xampp-control.exe",
    "qbittorrent.exe",
    "ueli.exe"
  ],
  "border_overflow_identifiers": [
    "Photoshop",
    "ArmCord.exe",
    "Beeper.exe",
    "Cron.exe",
    "Discord.exe",
    "DiscordCanary.exe",
    "DiscordDevelopment.exe",
    "DiscordPTB.exe",
    "EpicGamesLauncher.exe",
    "Flow.Launcher.exe",
    "GalaxyClient.exe",
    "GodotManager.exe",
    "Houdoku.exe",
    "itch.exe",
    "Kotatogram.exe",
    "lghub.exe",
    "ManyCam.exe",
    "EXCEL.EXE",
    "OUTLOOK.EXE",
    "POWERPNT.EXE",
    "Teams.exe",
    "WINWORD.EXE",
    "NVIDIA GeForce Experience.exe",
    "nhm_app.exe",
    "Notion Enhanced.exe",
    "DocEditorsWindowClass",
    "Obsidian.exe",
    "Plexamp.exe",
    "ProtonVPN.exe",
    "RoundedTB.exe",
    "ShareX.exe",
    "Slack.exe",
    "slack.exe",
    "Spotify.exe",
    "vguiPopupWindow",
    "Telegram.exe",
    "UnrealEditor.exe",
    "Code.exe",
    "VoiceAI.exe"
  ],
  "name_change_on_launch_identifiers": [
    "firefox.exe",
    "idea64.exe",
    "GodotManager.exe",
    "pycharm64.exe",
    "rider64.exe",
    "devenv.exe",
    "mpvnet.exe"
  ]
}
Felipesilvan commented 10 months ago

I had the same issue. The solution I found was to add the code bellow to the application.yaml file. Attention to the "F3 MinFrame f24b0000". It is related with the userform toolbox. Sometimes the final number changes (track it with ahk windows spy) and you have to update or manually toggle the float rule. It's good have a macro that does it for you.

- name: Microsoft Excel VBA
  identifier:
    kind: Exe
    id: EXCEL.EXE
  options:
  - border_overflow
  - layered
  float_identifiers:
  - kind: Class
    id: VbaWindow
    comment: Hidden window after openning VBA editor  
- name: VBA
  identifier:
    kind: Class
    id: wndclass_desked_gsk
  options:
  - border_overflow
  - layered 
- name: VBA UserForm
  identifier:
    kind: Exe
    id: EXCEL.EXE
  options:
  - border_overflow
  - layered
  float_identifiers:
  - kind: Class
    id: DesignerWindow
    comment: UserForm hidden window 
- name: VBA Toolbox
  identifier:
    kind: Exe
    id: EXCEL.EXE
  options:
  - border_overflow
  - layered
  float_identifiers:
  - kind: Class
    id: F3 MinFrame f24b0000
    comment: UserForm Toolbox window
melMass commented 6 months ago

Slack does it too, if you minimize a window it's still considered in the layout

LGUG2Z commented 5 months ago

It should be possible to address this now in user configs with all the various custom matchers (particularly StartsWith and Regex)