[BUG]: Maximize -> focus next -> panic #170

Closed
opened 2026-01-05 14:48:42 +01:00 by adam · 1 comment
Owner

Originally created by @kuznetsss on GitHub (Jan 4, 2023).

Originally assigned to: @LGUG2Z on GitHub.

Describe the bug
Komorebi panics and doesn't receive commands from komorebic if I maximize window and then try to move to another not maximized window using focus next.
Panic log message:

ERROR process_command{CycleFocusWindow(Next)}:focus_container_in_cycle_direction{direction=Next}:toggle_maximize:maximize_window: komorebi: panicked at 'removal index (is 1) should be < len (is 1)', komorebi\src\workspace.rs:859:42 panic.file="komorebi\\src\\workspac
e.rs" panic.line=859 panic.column=42

To Reproduce
Steps to reproduce the behavior:

  1. Config to reproduce the issue:
#SingleInstance Force
#Include %A_ScriptDir%\komorebic.lib.ahk
#Include %A_ScriptDir%\komorebi.generated.ahk
WindowHidingBehaviour("minimize")
EnsureWorkspaces(0, 1)
EnsureWorkspaces(1, 1)
InvisibleBorders(0, 0, 0, 0)
FocusFollowsMouse("enable", "windows")
MouseFollowsFocus("enable")
ContainerPadding(0, 0, 0)
WorkspacePadding(0, 0, 0)
ContainerPadding(1, 0, 0)
WorkspacePadding(1, 0, 0)

FloatRule("exe", "Teams.exe")

CompleteConfiguration()

#j::
CycleFocus("previous")
return

#k::
CycleFocus("next")
return

#m::
ToggleMaximize()
return
  1. Open 2 windows (I used alacritty).
  2. Run komorebi.exe (v 0.1.14) with this config.
  3. Wait until all setup commands from are executing.
  4. Press Win+m to maximze one window.
  5. Press Win+k to focus next.
  6. Window will be changed but after that komorebi stops to receive any commands from komorebic.

Expected behavior
Komorebi continue to work fine

Screenshots and Videos
Sorry I can't provide any videos or screenshots. But here is the komorebi log related to the bug:

2023-01-04T10:43:45.997725Z  INFO process_command{ToggleMaximize}:toggle_maximize:maximize_window: komorebi::window_manager: maximizing windowj
2023-01-04T10:43:46.012850Z  INFO process_command{ToggleMaximize}:toggle_maximize:update_focused_workspace{follow_focus=true}: komorebi::window_manager: updating
2023-01-04T10:43:46.016176Z  INFO process_command{ToggleMaximize}: komorebi::process_command: processed
2023-01-04T10:43:47.460668Z  INFO process_command{CycleFocusWindow(Next)}:focus_container_in_cycle_direction{direction=Next}: komorebi::window_manager: focusing container
2023-01-04T10:43:47.460938Z  INFO process_command{CycleFocusWindow(Next)}:focus_container_in_cycle_direction{direction=Next}:unmaximize_window: komorebi::window_manager: unmaximizing window
2023-01-04T10:43:47.461238Z  INFO process_command{CycleFocusWindow(Next)}:focus_container_in_cycle_direction{direction=Next}:unmaximize_window:focus_container{idx=0}: komorebi::workspace: focusing container
2023-01-04T10:43:47.479293Z  INFO process_command{CycleFocusWindow(Next)}:focus_container_in_cycle_direction{direction=Next}:focus_container{idx=1}: komorebi::workspace: focusing container
2023-01-04T10:43:47.479640Z  INFO process_command{CycleFocusWindow(Next)}:focus_container_in_cycle_direction{direction=Next}:toggle_maximize:maximize_window: komorebi::window_manager: maximizing windowj
2023-01-04T10:43:47.485899Z ERROR process_command{CycleFocusWindow(Next)}:focus_container_in_cycle_direction{direction=Next}:toggle_maximize:maximize_window: komorebi: panicked at 'removal index (is 1) should be < len (is 1)', komorebi\src\workspace.rs:859:42 panic.file="komorebi\\src\\workspac
e.rs" panic.line=859 panic.column=42
2023-01-04T10:43:52.474959Z  INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 198938 })}:reconcile_monitors:focus_container{idx=0}: komorebi::workspace: focusing container
2023-01-04T10:43:52.475648Z  INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 198938 })}:focus_monitor{idx=1}: komorebi::window_manager: focusing monitor
2023-01-04T10:43:52.476426Z  INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 198938 })}:focus_window{idx=0}: komorebi::container: focusing window
2023-01-04T10:43:52.476787Z  INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 198938 })}:focus_container{idx=0}: komorebi::workspace: focusing container
2023-01-04T10:43:52.479615Z  INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 198938 })}: komorebi::process_event: processed: (hwnd: 198938, title: C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe, exe: alacritty.exe, class: Window Class)
2023-01-04T10:43:56.490313Z  INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 8979128 })}:reconcile_monitors:focus_container{idx=0}: komorebi::workspace: focusing container
2023-01-04T10:43:56.490818Z  INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 8979128 })}:focus_monitor{idx=1}: komorebi::window_manager: focusing monitor
2023-01-04T10:43:56.491325Z ERROR komorebi::process_event: there is no container/window

Operating System
OS Name: Microsoft Windows 10 Enterprise
OS Version: 10.0.19044 N/A Build 19044

Additional context

Originally created by @kuznetsss on GitHub (Jan 4, 2023). Originally assigned to: @LGUG2Z on GitHub. **Describe the bug** Komorebi panics and doesn't receive commands from komorebic if I maximize window and then try to move to another not maximized window using focus next. Panic log message: ``` ERROR process_command{CycleFocusWindow(Next)}:focus_container_in_cycle_direction{direction=Next}:toggle_maximize:maximize_window: komorebi: panicked at 'removal index (is 1) should be < len (is 1)', komorebi\src\workspace.rs:859:42 panic.file="komorebi\\src\\workspac e.rs" panic.line=859 panic.column=42 ``` **To Reproduce** Steps to reproduce the behavior: 1. Config to reproduce the issue: ``` #SingleInstance Force #Include %A_ScriptDir%\komorebic.lib.ahk #Include %A_ScriptDir%\komorebi.generated.ahk WindowHidingBehaviour("minimize") EnsureWorkspaces(0, 1) EnsureWorkspaces(1, 1) InvisibleBorders(0, 0, 0, 0) FocusFollowsMouse("enable", "windows") MouseFollowsFocus("enable") ContainerPadding(0, 0, 0) WorkspacePadding(0, 0, 0) ContainerPadding(1, 0, 0) WorkspacePadding(1, 0, 0) FloatRule("exe", "Teams.exe") CompleteConfiguration() #j:: CycleFocus("previous") return #k:: CycleFocus("next") return #m:: ToggleMaximize() return ``` 2. Open 2 windows (I used alacritty). 2. Run komorebi.exe (v 0.1.14) with this config. 3. Wait until all setup commands from are executing. 4. Press `Win+m` to maximze one window. 5. Press `Win+k` to focus next. 6. Window will be changed but after that komorebi stops to receive any commands from komorebic. **Expected behavior** Komorebi continue to work fine **Screenshots and Videos** Sorry I can't provide any videos or screenshots. But here is the komorebi log related to the bug: ``` 2023-01-04T10:43:45.997725Z INFO process_command{ToggleMaximize}:toggle_maximize:maximize_window: komorebi::window_manager: maximizing windowj 2023-01-04T10:43:46.012850Z INFO process_command{ToggleMaximize}:toggle_maximize:update_focused_workspace{follow_focus=true}: komorebi::window_manager: updating 2023-01-04T10:43:46.016176Z INFO process_command{ToggleMaximize}: komorebi::process_command: processed 2023-01-04T10:43:47.460668Z INFO process_command{CycleFocusWindow(Next)}:focus_container_in_cycle_direction{direction=Next}: komorebi::window_manager: focusing container 2023-01-04T10:43:47.460938Z INFO process_command{CycleFocusWindow(Next)}:focus_container_in_cycle_direction{direction=Next}:unmaximize_window: komorebi::window_manager: unmaximizing window 2023-01-04T10:43:47.461238Z INFO process_command{CycleFocusWindow(Next)}:focus_container_in_cycle_direction{direction=Next}:unmaximize_window:focus_container{idx=0}: komorebi::workspace: focusing container 2023-01-04T10:43:47.479293Z INFO process_command{CycleFocusWindow(Next)}:focus_container_in_cycle_direction{direction=Next}:focus_container{idx=1}: komorebi::workspace: focusing container 2023-01-04T10:43:47.479640Z INFO process_command{CycleFocusWindow(Next)}:focus_container_in_cycle_direction{direction=Next}:toggle_maximize:maximize_window: komorebi::window_manager: maximizing windowj 2023-01-04T10:43:47.485899Z ERROR process_command{CycleFocusWindow(Next)}:focus_container_in_cycle_direction{direction=Next}:toggle_maximize:maximize_window: komorebi: panicked at 'removal index (is 1) should be < len (is 1)', komorebi\src\workspace.rs:859:42 panic.file="komorebi\\src\\workspac e.rs" panic.line=859 panic.column=42 2023-01-04T10:43:52.474959Z INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 198938 })}:reconcile_monitors:focus_container{idx=0}: komorebi::workspace: focusing container 2023-01-04T10:43:52.475648Z INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 198938 })}:focus_monitor{idx=1}: komorebi::window_manager: focusing monitor 2023-01-04T10:43:52.476426Z INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 198938 })}:focus_window{idx=0}: komorebi::container: focusing window 2023-01-04T10:43:52.476787Z INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 198938 })}:focus_container{idx=0}: komorebi::workspace: focusing container 2023-01-04T10:43:52.479615Z INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 198938 })}: komorebi::process_event: processed: (hwnd: 198938, title: C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe, exe: alacritty.exe, class: Window Class) 2023-01-04T10:43:56.490313Z INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 8979128 })}:reconcile_monitors:focus_container{idx=0}: komorebi::workspace: focusing container 2023-01-04T10:43:56.490818Z INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 8979128 })}:focus_monitor{idx=1}: komorebi::window_manager: focusing monitor 2023-01-04T10:43:56.491325Z ERROR komorebi::process_event: there is no container/window ``` **Operating System** OS Name: Microsoft Windows 10 Enterprise OS Version: 10.0.19044 N/A Build 19044 **Additional context**
adam added the bug label 2026-01-05 14:48:42 +01:00
adam closed this issue 2026-01-05 14:48:42 +01:00
Author
Owner

@kuznetsss commented on GitHub (Jan 4, 2023):

Thanks for the quick fix!

@kuznetsss commented on GitHub (Jan 4, 2023): Thanks for the quick fix!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#170