So can I make focus and cycle-focus work like focus-follows-mouse in komorebi, or is it possible to fix?
Originally created by @MasouShizuka on GitHub (Jul 14, 2022).
I use [TablacusExplorer](https://github.com/tablacus/TablacusExplorer) as explorer. When using `komorebi`, it can't get input focus when changing focus, causing shortcuts not work, as follows.
- After `focus` or `cycle- focus`, `tablacus` lost the input focus and can't switch file by `up` and `down`.
https://user-images.githubusercontent.com/44764707/178860635-892c9ff9-bf50-4c70-bab3-e2b502bb1935.mp4
- But I found that if changing focus by `focus-follows-mouse`, `tablacus` doesn't lose focus and work.
https://user-images.githubusercontent.com/44764707/178860914-d8a1b6ce-bcdf-43ba-ac5d-9501e226505d.mp4
So can I make `focus` and `cycle-focus` work like `focus-follows-mouse` in `komorebi`, or is it possible to fix?
Sets the keyboard focus to the specified window. The window must be attached to the calling thread's message queue.
I have noticed that when the Tablacus Explorer window is moved using the CLI commands (using SetWindowPos that the same behaviour happens and the keyboard focus is lost.
I'm not 100% sure, but since I have never seen this sort of issue before with other applications there is a chance that this might be related to the signal handling in the Tablacus Explorer app itself.
In the meantime I'll have a look through the Win32 docs to see if there are any other functions that may be called to change keyboard focus by window handle and report back if I find anything.
@LGUG2Z commented on GitHub (Jul 14, 2022):
I am able to reproduce this behaviour locally. `komorebi` uses [`SetFocus`](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setfocus) whenenver a window is [focused using CLI commands](https://github.com/LGUG2Z/komorebi/blob/master/komorebi/src/window.rs#L233)
> Sets the keyboard focus to the specified window. The window must be attached to the calling thread's message queue.
I have noticed that when the Tablacus Explorer window is moved using the CLI commands (using [`SetWindowPos`](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowpos) that the same behaviour happens and the keyboard focus is lost.
I'm not 100% sure, but since I have never seen this sort of issue before with other applications there is a chance that this might be related to the signal handling in the Tablacus Explorer app itself.
In the meantime I'll have a look through the Win32 docs to see if there are any other functions that may be called to change keyboard focus by window handle and report back if I find anything.
I also tried workspacer, and it doesn't have such a problem.
Maybe this can help.
@MasouShizuka commented on GitHub (Jul 14, 2022):
I also tried [workspacer](https://github.com/workspacer/workspacer), and it doesn't have such a problem.
Maybe this can help.
This seems to be the only difference in focus handling. I just tried implementing this in komorebi but unfortunately I am seeing the same behaviour with Tablacus Explorer. 😞
@LGUG2Z commented on GitHub (Jul 14, 2022):
[This](https://github.com/workspacer/workspacer/commit/1c02613cea485f1ae97f70d6399f7124aeb31297) seems to be the only difference in focus handling. I just tried implementing this in `komorebi` but unfortunately I am seeing the same behaviour with Tablacus Explorer. 😞
I found that an extra window opens when opening the TablacusExplorer for the first time(delete the config folder), and if the extra window is focused, the input focus will work, as follows.
@MasouShizuka commented on GitHub (Jul 15, 2022):
I found that an extra window opens when opening the `TablacusExplorer` for the first time(delete the `config` folder), and if the extra window is focused, the input focus will work, as follows.
https://user-images.githubusercontent.com/44764707/179135001-c220656e-230d-4b7b-a63a-507481c75579.mp4
And the hwnd of TablacusExplorer in the titlebar is from command komorebic state.
@MasouShizuka commented on GitHub (Jul 15, 2022):
I tried using win32 api in python to set foreground window, and it also doesn't have such a problem, as follows.
(`komorebi` is paused)
https://user-images.githubusercontent.com/44764707/179154093-adb3b72f-ccd7-412a-95cf-a2d7f3653072.mp4
And the `hwnd` of `TablacusExplorer` in the titlebar is from command `komorebic state`.
There have been a lot of changes in the last two years, do you know if this is still an issue @MasouShizuka ?
@LGUG2Z commented on GitHub (May 13, 2024):
There have been a lot of changes in the last two years, do you know if this is still an issue @MasouShizuka ?
@MasouShizuka commented on GitHub (May 13, 2024):
This problem should be solved after https://github.com/LGUG2Z/komorebi/commit/732aca77b54e3a1133408edc92727a45c0ec88fc.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @MasouShizuka on GitHub (Jul 14, 2022).
I use TablacusExplorer as explorer. When using
komorebi, it can't get input focus when changing focus, causing shortcuts not work, as follows.focusorcycle- focus,tablacuslost the input focus and can't switch file byupanddown.https://user-images.githubusercontent.com/44764707/178860635-892c9ff9-bf50-4c70-bab3-e2b502bb1935.mp4
focus-follows-mouse,tablacusdoesn't lose focus and work.https://user-images.githubusercontent.com/44764707/178860914-d8a1b6ce-bcdf-43ba-ac5d-9501e226505d.mp4
So can I make
focusandcycle-focuswork likefocus-follows-mouseinkomorebi, or is it possible to fix?@LGUG2Z commented on GitHub (Jul 14, 2022):
I am able to reproduce this behaviour locally.
komorebiusesSetFocuswhenenver a window is focused using CLI commandsI have noticed that when the Tablacus Explorer window is moved using the CLI commands (using
SetWindowPosthat the same behaviour happens and the keyboard focus is lost.I'm not 100% sure, but since I have never seen this sort of issue before with other applications there is a chance that this might be related to the signal handling in the Tablacus Explorer app itself.
In the meantime I'll have a look through the Win32 docs to see if there are any other functions that may be called to change keyboard focus by window handle and report back if I find anything.
@MasouShizuka commented on GitHub (Jul 14, 2022):
I also tried workspacer, and it doesn't have such a problem.
Maybe this can help.
@LGUG2Z commented on GitHub (Jul 14, 2022):
This seems to be the only difference in focus handling. I just tried implementing this in
komorebibut unfortunately I am seeing the same behaviour with Tablacus Explorer. 😞@MasouShizuka commented on GitHub (Jul 15, 2022):
I found that an extra window opens when opening the
TablacusExplorerfor the first time(delete theconfigfolder), and if the extra window is focused, the input focus will work, as follows.https://user-images.githubusercontent.com/44764707/179135001-c220656e-230d-4b7b-a63a-507481c75579.mp4
@MasouShizuka commented on GitHub (Jul 15, 2022):
I tried using win32 api in python to set foreground window, and it also doesn't have such a problem, as follows.
(
komorebiis paused)https://user-images.githubusercontent.com/44764707/179154093-adb3b72f-ccd7-412a-95cf-a2d7f3653072.mp4
And the
hwndofTablacusExplorerin the titlebar is from commandkomorebic state.@LGUG2Z commented on GitHub (May 13, 2024):
There have been a lot of changes in the last two years, do you know if this is still an issue @MasouShizuka ?
@MasouShizuka commented on GitHub (May 13, 2024):
This problem should be solved after https://github.com/LGUG2Z/komorebi/commit/732aca77b54e3a1133408edc92727a45c0ec88fc.