Is there any way to make a window handled by komorebi manually? #16

Closed
opened 2026-01-05 14:47:40 +01:00 by adam · 7 comments
Owner

Originally created by @crosstyan on GitHub (Aug 19, 2021).

Originally assigned to: @LGUG2Z on GitHub.

I have several programs that can't be handle by komorebi. The window of certain program always keeps floating and komorebic state doesn't show that window.

I assume that komorebi can handle a window by passing a hwnd, which I can easily get with AHK or other script, as parameter. If I'm right, I believe a komorebic subcommand like komorebic force-window-tiling <hwnd> would be helpful for komorebi to handle that window manually.

Besides, it would be better if a command like komorebic manage-window <hwnd> <do-something-to-that-window>..., which is helpful for scripting.

Originally created by @crosstyan on GitHub (Aug 19, 2021). Originally assigned to: @LGUG2Z on GitHub. I have several programs that can't be handle by komorebi. The window of certain program always keeps floating and `komorebic state` doesn't show that window. I assume that komorebi can handle a window by passing a `hwnd`, which I can easily get with AHK or other script, as parameter. If I'm right, I believe a komorebic subcommand like `komorebic force-window-tiling <hwnd>` would be helpful for komorebi to handle that window manually. Besides, it would be better if a command like `komorebic manage-window <hwnd> <do-something-to-that-window>...`, which is helpful for scripting.
adam added the enhancement label 2026-01-05 14:47:40 +01:00
adam closed this issue 2026-01-05 14:47:40 +01:00
Author
Owner

@LGUG2Z commented on GitHub (Aug 19, 2021):

To have a komorebic command that forces tiling of a window is a great idea, I will add this soon.

I'm curious to know which windows are not getting managed by default.

This is the hook that decides whether or not to try to handle a WinEvent, first by trying to create a WindowManagerEvent from known WinEvents and then by applying some heuristics to see if the window should be managed.

Ideally, all windows should be tiled by default unless there is a specific rule configured to float them.

Can you give me some examples of apps, their window classes and styles that are failing to tile automatically?

@LGUG2Z commented on GitHub (Aug 19, 2021): To have a `komorebic` command that forces tiling of a window is a great idea, I will add this soon. I'm curious to know which windows are not getting managed by default. [This](https://github.com/LGUG2Z/komorebi/blob/master/komorebi/src/windows_callbacks.rs#L57) is the hook that decides whether or not to try to handle a WinEvent, first by trying to [create a WindowManagerEvent from known WinEvents](https://github.com/LGUG2Z/komorebi/blob/master/komorebi/src/window_manager_event.rs#L71) and then by [applying some heuristics to see if the window should be managed](https://github.com/LGUG2Z/komorebi/blob/master/komorebi/src/window.rs#L206). Ideally, all windows should be tiled by default unless there is a specific rule configured to float them. Can you give me some examples of apps, their window classes and styles that are failing to tile automatically?
Author
Owner

@crosstyan commented on GitHub (Aug 19, 2021):

Can you give me some examples of apps, their window classes and styles that are failing to tile automatically?

  • A chat app popular in China called TIM/QQ, whose window class is TXGuiFoundation (TX is the company created this app) and exe is TIM.exe
  • Internet Download Manager. The window class is #32770 and exe is IDMan.exe

A command to add rule like float-rule will be a good idea indeed, I can add the window class or exe to that rule.

@crosstyan commented on GitHub (Aug 19, 2021): > Can you give me some examples of apps, their window classes and styles that are failing to tile automatically? - A chat app popular in China called [TIM/QQ](https://tim.qq.com/), whose window class is `TXGuiFoundation` (TX is the company created this app) and exe is `TIM.exe` - [Internet Download Manager](https://www.internetdownloadmanager.com/). The window class is `#32770` and exe is `IDMan.exe` A command to add rule like `float-rule` will be a good idea indeed, I can add the window class or exe to that rule.
Author
Owner

@LGUG2Z commented on GitHub (Aug 19, 2021):

@crosstyan I have added komorebic manage and komorebic unmanage to forcibly manage and unmanage windows that don't automatically get tiled. Technically, you could also forcibly unmanage any window, but any window that is automatically registered for tiling at startup would just be tiled again on the next WinEvent.

@LGUG2Z commented on GitHub (Aug 19, 2021): @crosstyan I have added `komorebic manage` and `komorebic unmanage` to forcibly manage and unmanage windows that don't automatically get tiled. Technically, you could also forcibly unmanage any window, but any window that is automatically registered for tiling at startup would just be tiled again on the next WinEvent.
Author
Owner

@crosstyan commented on GitHub (Aug 19, 2021):

@LGUG2Z That's really quick.

However when I try out the latest commit 8ffe6f78b7 I get error from komorebi

Aug 20 05:20:06.127 ERROR new{incoming=Mutex { data: Receiver { .. } }}: komorebi: panicked at 'could not determine the current virtual desktop number: ServiceNotCreated', komorebi\src\window_manager.rs:100:10 panic.file="komorebi\\src\\window_manager.rs" panic.line=100 panic.column=10

I think this error is concerning 74811fbe13 because the error keeps appearing until rolling back to 209cd82892 (and it's about virtual desktop)

@crosstyan commented on GitHub (Aug 19, 2021): @LGUG2Z That's really quick. However when I try out the latest commit 8ffe6f78b7c2a41d1bbe7768c595ca7bf5e41570 I get error from komorebi ```log Aug 20 05:20:06.127 ERROR new{incoming=Mutex { data: Receiver { .. } }}: komorebi: panicked at 'could not determine the current virtual desktop number: ServiceNotCreated', komorebi\src\window_manager.rs:100:10 panic.file="komorebi\\src\\window_manager.rs" panic.line=100 panic.column=10 ``` I think this error is concerning 74811fbe1314e85a1e2332c1ca42caebede1a6a9 because the error keeps appearing until rolling back to 209cd8289249ecdbfbe7a400bd5e42071c032da2 (and it's about `virtual desktop`)
Author
Owner

@LGUG2Z commented on GitHub (Aug 19, 2021):

This was some bad error handling on my part. 😅 Should hopefully be fixed in the latest commit on master, and the commit before that includes support for komorebi manage-rule exe TIM.exe etc.

@LGUG2Z commented on GitHub (Aug 19, 2021): This was some bad error handling on my part. 😅 Should hopefully be fixed in the latest commit on master, and the [commit before that](https://github.com/LGUG2Z/komorebi/commit/4e9b2948350e10e85c52b9b36d8984b56a59cb63) includes support for `komorebi manage-rule exe TIM.exe` etc.
Author
Owner

@LGUG2Z commented on GitHub (Aug 20, 2021):

@crosstyan Is the latest commit on master working out for you now?

@LGUG2Z commented on GitHub (Aug 20, 2021): @crosstyan Is the latest commit on `master` working out for you now?
Author
Owner

@crosstyan commented on GitHub (Aug 20, 2021):

@LGUG2Z Sorry for the late reply. I was busy dealing with other stuff today, and yes, the new manage-rule is wonderful

For some reason Internet Download Manager is still floating though. I think it's because its weird window class #32770 , which means dialog box. It's not a big issue because I prefer it floating anyway.

komorebi is quite perfect for my daily life now, thank you.

Issue closed!

@crosstyan commented on GitHub (Aug 20, 2021): @LGUG2Z Sorry for the late reply. I was busy dealing with other stuff today, and yes, the new `manage-rule` is wonderful For some reason [Internet Download Manager](https://www.internetdownloadmanager.com/) is still floating though. I think it's because its weird window class `#32770` , [which means dialog box](https://docs.microsoft.com/en-us/windows/win32/winmsg/about-window-classes). It's not a big issue because I prefer it floating anyway. `komorebi` is quite perfect for my daily life now, thank you. Issue closed!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#16