Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Workspace switching loop #879

Open
Insprill opened this issue Jun 14, 2024 · 10 comments
Open

[BUG]: Workspace switching loop #879

Insprill opened this issue Jun 14, 2024 · 10 comments
Labels
bug Something isn't working i-am-stuck I don't know what to do next - maybe someone else does? i-will-not-work-on-this I'm not going to work on this, but someone else is welcome to komorebi Related to the komorebi crate

Comments

@Insprill
Copy link

Describe the bug
When focusing an application in another workspace, it will sometimes get stuck in an infinite workspace-switching loop that can only be stopped by killing komorebi and the application via task manager. It would appear that 07b2da6 didn't fully fix the issue. It's quite rare now; I've only had it happen twice in the last three weeks when Unity focuses on Rider (something that happens at least 50 times a day for me) but it does still happen.

To Reproduce
*see additional context

  1. Open Unity and Rider on different workspaces.
  2. Open a script in Unity so it focuses Rider.
  3. Get lucky?

Expected behavior
Komorebi should not get stuck in a workspace-switching loop.

Operating System

OS Name:                   Microsoft Windows 11 Pro for Workstations
OS Version:                10.0.22631 N/A Build 22631

komorebic check Output

No KOMOREBI_CONFIG_HOME detected, defaulting to C:\Users\Insprill

Looking for configuration files in C:\Users\Insprill

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

No ~/.config/whkdrc found; you may not be able to control komorebi with your keyboard

Additional context
I've only had this happen when Unity focuses Rider (e.g., when opening a script), so it's possible the issue lies somewhere in there, but I find it more likely it's a general issue that only shows itself there due to how often that happens.

@Insprill Insprill added the bug Something isn't working label Jun 14, 2024
@LGUG2Z
Copy link
Owner

LGUG2Z commented Jun 14, 2024

I think this will ultimately require some tuneable configuration parameters that can be set by the user, but for now when you do get hit with this bug you can probably hit alt-p to komorebic pause to get out of the loop

@LGUG2Z
Copy link
Owner

LGUG2Z commented Jun 19, 2024

8bf4ab9

This may have some impact on this issue

@melMass
Copy link

melMass commented Jul 20, 2024

I'm experiencing this in a very reproducible manner with HoudiniFX (3D VFX QT application), I'll try Alt+P next time as only killing Komorebi works for now

@rwijtvliet
Copy link

I'm very regularly experiencing this when restarting komorebi and (manually) redistributing the windows over the various workspaces. I invariably reach a point where it will start looping through the workspaces, though I have not found a way to reliably reproduce. If it helps, the applications that are usually open are wezterm, outlook, edge, teams.

@LGUG2Z
Copy link
Owner

LGUG2Z commented Nov 22, 2024

(manually) redistributing the windows over the various workspaces

Curious to know why setting initial_workspace_rules for the apps you always want to move to different workspaces on restart isn't an option 👀

@rwijtvliet
Copy link

(manually) redistributing the windows over the various workspaces

Curious to know why setting initial_workspace_rules for the apps you always want to move to different workspaces on restart isn't an option 👀

Ah, I actually have those in place normally. I just temporarily removed them, because I thought they might be causing the issue. But turns out, the issue also arises when they are absent.

@rwijtvliet
Copy link

Is there something I can do to help find the issue?

@rwijtvliet
Copy link

I recorded the output of komorebi during one of the loops, maybe it is helpful in finding the source. Here is one second's worth:

2024-12-03T11:55:43.028109Z  INFO process_event{event="Uncloak" winevent="ObjectUncloaked" hwnd=131806}: komorebi::process_event: processed: (hwnd: 131806, title: /c/Users/, exe: wezterm-gui.exe, class: org.wezfurlong.wezterm)
2024-12-03T11:55:43.028636Z  INFO focus_monitor{idx=0}: komorebi::window_manager: focusing monitor
2024-12-03T11:55:43.028816Z  INFO focus_workspace{idx=3}: komorebi::monitor: focusing workspace
2024-12-03T11:55:43.036931Z  INFO focus_window{idx=0}: komorebi::container: focusing window
2024-12-03T11:55:43.054862Z  INFO komorebi::workspace_reconciliator: running reconciliation
2024-12-03T11:55:43.055646Z  INFO focus_monitor{idx=2}: komorebi::window_manager: focusing monitor
2024-12-03T11:55:43.056186Z  INFO focus_workspace{idx=0}: komorebi::monitor: focusing workspace
2024-12-03T11:55:43.086046Z  INFO focus_window{idx=0}: komorebi::container: focusing window
2024-12-03T11:55:43.137523Z  INFO komorebi::workspace_reconciliator: running reconciliation
2024-12-03T11:55:43.175011Z  INFO process_event{event="Uncloak" winevent="ObjectUncloaked" hwnd=67288}: komorebi::process_event: processed: (hwnd: 67288, title: Inbox - Outlook, exe: OUTLOOK.EXE, class: rctrl_renwnd32)
2024-12-03T11:55:43.176176Z  INFO focus_monitor{idx=0}: komorebi::window_manager: focusing monitor
2024-12-03T11:55:43.177685Z  INFO focus_workspace{idx=7}: komorebi::monitor: focusing workspace
2024-12-03T11:55:43.203938Z  INFO focus_window{idx=0}: komorebi::container: focusing window
2024-12-03T11:55:43.231285Z  INFO komorebi::workspace_reconciliator: running reconciliation
2024-12-03T11:55:43.233390Z  INFO focus_monitor{idx=1}: komorebi::window_manager: focusing monitor
2024-12-03T11:55:43.234032Z  INFO focus_workspace{idx=0}: komorebi::monitor: focusing workspace
2024-12-03T11:55:43.284462Z  INFO focus_window{idx=0}: komorebi::container: focusing window
2024-12-03T11:55:43.360284Z  INFO komorebi::workspace_reconciliator: running reconciliation
2024-12-03T11:55:43.390766Z  INFO process_event{event="Uncloak" winevent="ObjectUncloaked" hwnd=66936}: komorebi::process_event: processed: (hwnd: 66936, title: Home | Service Portal and 14 more pages - Work - Microsoft Edge, exe: msedge.exe, class: Chrome_WidgettWin_1)
2024-12-03T11:55:43.391359Z  INFO focus_monitor{idx=0}: komorebi::window_manager: focusing monitor
2024-12-03T11:55:43.391617Z  INFO focus_workspace{idx=1}: komorebi::monitor: focusing workspace
2024-12-03T11:55:43.407679Z  INFO focus_window{idx=0}: komorebi::container: focusing window
2024-12-03T11:55:43.509780Z  INFO process_event{event="Cloak" winevent="ObjectCloaked" hwnd=66936}: komorebi::process_event: processed: (hwnd: 66936, title: Home | Service Portal and 14 more pages - Work - Microsoft Edge, exe: msedge.exe, class: Chrome_WidgetWin__1)
2024-12-03T11:55:43.524864Z  INFO process_event{event="Cloak" winevent="ObjectCloaked" hwnd=329116}: komorebi::process_event: processed: (hwnd: 329116, title: /c/Users/, exe: wezterm-gui.exe, class: org.wezfurlong.wezterm)
2024-12-03T11:55:43.534127Z  INFO process_event{event="Cloak" winevent="ObjectCloaked" hwnd=131806}: komorebi::process_event: processed: (hwnd: 131806, title: /c/Users/, exe: wezterm-gui.exe, class: org.wezfurlong.wezterm)
2024-12-03T11:55:43.550732Z  INFO process_event{event="Cloak" winevent="ObjectCloaked" hwnd=67024}: komorebi::process_event: processed: (hwnd: 67024, title: Chat standup | Microsoft Teams, exe: ms-teams.exe, class: TeamsWebView)
2024-12-03T11:55:43.565293Z  INFO process_event{event="Cloak" winevent="ObjectCloaked" hwnd=67288}: komorebi::process_event: processed: (hwnd: 67288, title: Inbox - Outlook, exe: OUTLOOK.EXE, class: rctrl_renwnd32)
2024-12-03T11:55:43.594081Z  INFO komorebi::workspace_reconciliator: focusing alt-tabbed
window
2024-12-03T11:55:43.611595Z  WARN process_event{event="Uncloak" winevent="ObjectUncloaked" hwnd=66936}: komorebi::workspace_reconciliator: channel is full; dropping notification
2024-12-03T11:55:43.628966Z  WARN process_event{event="Uncloak" winevent="ObjectUncloaked" hwnd=66936}: komorebi::workspace_reconciliator: channel is full; dropping notification
2024-12-03T11:55:43.638230Z  INFO process_event{event="Uncloak" winevent="ObjectUncloaked" hwnd=66936}: komorebi::process_event: processed: (hwnd: 66936, title: Home | Service Portal and 14 more pages - Work - Microsoft Edge, exe: msedge.exe, class: Chrome_WidgettWin_1)
2024-12-03T11:55:43.638824Z  INFO komorebi::workspace_reconciliator: running reconciliation
2024-12-03T11:55:43.644712Z  INFO focus_monitor{idx=2}: komorebi::window_manager: focusing monitor
2024-12-03T11:55:43.645016Z  INFO focus_workspace{idx=0}: komorebi::monitor: focusing workspace
2024-12-03T11:55:43.676716Z  INFO focus_window{idx=0}: komorebi::container: focusing window
2024-12-03T11:55:43.686434Z  INFO process_event{event="FocusChange" winevent="SystemForeground" hwnd=329116}:focus_monitor{idx=0}: komorebi::window_manager: focusing monitor
2024-12-03T11:55:43.701040Z  INFO process_event{event="FocusChange" winevent="SystemForeground" hwnd=329116}:update_focused_workspace{follow_focus=false trigger_focus=false}: komorebi::window_manager: updating
2024-12-03T11:55:43.702825Z ERROR komorebi::process_event: there is no container/window
2024-12-03T11:55:43.734665Z  INFO process_event{event="TitleUpdate" winevent="ObjectNameChange" hwnd=329116}: komorebi::process_event: processed: (hwnd: 329116, title: /c/Users/, exe: wezterm-gui.exe, class: org.wezfurlong.wezterm)
2024-12-03T11:55:43.768099Z  INFO process_event{event="Cloak" winevent="ObjectCloaked" hwnd=66936}: komorebi::process_event: processed: (hwnd: 66936, title: Home | Service Portal and 14 more pages - Work - Microsoft Edge, exe: msedge.exe, class: Chrome_WidgetWin__1)
2024-12-03T11:55:43.788580Z  INFO process_event{event="FocusChange" winevent="SystemForeground" hwnd=131806}:update_focused_workspace{follow_focus=false trigger_focus=false}: komorebi::window_manager: updating
2024-12-03T11:55:43.790497Z ERROR komorebi::process_event: there is no container/window
2024-12-03T11:55:43.805805Z  INFO process_event{event="Cloak" winevent="ObjectCloaked" hwnd=67024}: komorebi::process_event: processed: (hwnd: 67024, title: Chat standup | Microsoft Teams, exe: ms-teams.exe, class: TeamsWebView)
2024-12-03T11:55:43.829057Z  INFO process_event{event="TitleUpdate" winevent="ObjectNameChange" hwnd=131806}: komorebi::process_event: processed: (hwnd: 131806, title: /c/Users/, exe: wezterm-gui.exe, class: org.wezfurlong.wezterm)
2024-12-03T11:55:43.863940Z  INFO process_event{event="Cloak" winevent="ObjectCloaked" hwnd=67288}: komorebi::process_event: processed: (hwnd: 67288, title: Inbox - Outlook, exe: OUTLOOK.EXE, class: rctrl_renwnd32)
2024-12-03T11:55:43.894544Z  INFO process_event{event="TitleUpdate" winevent="ObjectNameChange" hwnd=329116}: komorebi::process_event: processed: (hwnd: 329116, title: /c/Users/, exe: wezterm-gui.exe, class: org.wezfurlong.wezterm)
2024-12-03T11:55:43.928124Z  INFO process_event{event="Cloak" winevent="ObjectCloaked" hwnd=394848}: komorebi::process_event: processed: (hwnd: 394848, title: Zeiten - OneNote, exe: ONENOTE.EXE, class: Framework::CFrame)
2024-12-03T11:55:43.947960Z  INFO process_event{event="TitleUpdate" winevent="ObjectNameChange" hwnd=329116}: komorebi::process_event: processed: (hwnd: 329116, title: /c/Users/, exe: wezterm-gui.exe, class: org.wezfurlong.wezterm)

@rwijtvliet
Copy link

rwijtvliet commented Dec 3, 2024

This may be helpful: on my machine a loop seems to only appear when multiple monitors are connected! They all show the same image. (the internal laptop monitor and 2 additional external ones).

I have not yet observed a loop if no external monitors are connected.

In the output above, I see several lines targeting distinct monitors - that might be a hint too. (focus_monitor{idx=2}: komorebi::window_manager: focusing monitor, but also with idx=1 and idx=0.)

@melMass
Copy link

melMass commented Dec 3, 2024

Dual monitor user too in case it matters!

@LGUG2Z LGUG2Z added i-will-not-work-on-this I'm not going to work on this, but someone else is welcome to komorebi Related to the komorebi crate i-am-stuck I don't know what to do next - maybe someone else does? labels Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working i-am-stuck I don't know what to do next - maybe someone else does? i-will-not-work-on-this I'm not going to work on this, but someone else is welcome to komorebi Related to the komorebi crate
Projects
None yet
Development

No branches or pull requests

4 participants