Closing a maximized window doesn't retile a workspace #21

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

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

Originally assigned to: @LGUG2Z on GitHub.

Using bc08e177a1

State

Step to reproduce:

  1. maximize a window with toggle-maximize
  2. open random window in the same workspace
  3. close that maximized window
  4. workspace doesn't get retiled and komorebic state is stuck

Logs

Aug 24 19:27:08.614  INFO read_commands:process_command{ToggleMaximize}:toggle_maximize:maximize_window: komorebi::window_manager: maximizing windowj
Aug 24 19:27:08.717  INFO read_commands:process_command{ToggleMaximize}:toggle_maximize:maximize_window:focus_container{idx=0}: komorebi::workspace: focusing container
Aug 24 19:27:08.720  INFO read_commands:process_command{ToggleMaximize}:toggle_maximize:update_focused_workspace{mouse_follows_focus=false}: komorebi::window_manager: updating
Aug 24 19:27:08.721  INFO read_commands:process_command{ToggleMaximize}: komorebi::process_command: processed
Aug 24 19:27:10.170  INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 3607882 })}:focus_monitor{idx=0}: komorebi::window_manager: focusing monitor
Aug 24 19:27:10.174  INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 3607882 })}:focus_window{idx=0}: komorebi::container: focusing window
Aug 24 19:27:10.181  INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 3607882 })}:focus_container{idx=0}: komorebi::workspace: focusing container
Aug 24 19:27:10.186  INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 3607882 })}: komorebi::process_event: processed: (hwnd: 3607882, title: PowerShell, exe: WindowsTerminal.exe, class: CASCADIA_HOSTING_WINDOW_CLASS)
Aug 24 19:27:17.932  INFO read_commands:process_command{State}: komorebi::process_command: processed
Aug 24 19:27:19.484  INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 1510166 })}:focus_monitor{idx=0}: komorebi::window_manager: focusing monitor
Aug 24 19:27:19.619 ERROR komorebi::process_event: there is no window
Aug 24 19:27:19.646  INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 3607882 })}:focus_monitor{idx=0}: komorebi::window_manager: focusing monitor
Aug 24 19:27:19.648  INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 3607882 })}:focus_window{idx=0}: komorebi::container: focusing window
Aug 24 19:27:19.651  INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 3607882 })}:focus_container{idx=0}: komorebi::workspace: focusing container
Aug 24 19:27:19.654  INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 3607882 })}: komorebi::process_event: processed: (hwnd: 3607882, title: PowerShell, exe: WindowsTerminal.exe, class: CASCADIA_HOSTING_WINDOW_CLASS)
Aug 24 19:27:21.532 ERROR read_commands:process_command{State}: komorebi: panicked at 'could not get window title:
   0: Invalid window handle. (os error 1400)

Location:
   /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\library\core\src\convert\mod.rs:538

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 4 frames hidden ⋮
   5: komorebi::windows_api::WindowsApi::window_text_w::h10220e080a3e3564
      at <unknown source file>:<unknown line>
   6: <komorebi::window::Window as serde::ser::Serialize>::serialize::hb6affc9158897738
      at <unknown source file>:<unknown line>
   7: serde::ser::SerializeMap::serialize_entry::h9e780eff8698181d
      at <unknown source file>:<unknown line>
   8: komorebi::workspace::_::<impl serde::ser::Serialize for komorebi::workspace::Workspace>::serialize::hed3005d319374c9a
      at <unknown source file>:<unknown line>
   9: serde::ser::SerializeMap::serialize_entry::h14bbebaf36b11624
      at <unknown source file>:<unknown line>
  10: komorebi::ring::_::<impl serde::ser::Serialize for komorebi::ring::Ring<T>>::serialize::h587e8b5a3f561623
      at <unknown source file>:<unknown line>
  11: serde::ser::SerializeMap::serialize_entry::h0f87d5f2613be75b
      at <unknown source file>:<unknown line>
  12: komorebi::monitor::_::<impl serde::ser::Serialize for komorebi::monitor::Monitor>::serialize::h8933ae57ded52645
      at <unknown source file>:<unknown line>
  13: serde::ser::SerializeMap::serialize_entry::h54cb280b1959a341
      at <unknown source file>:<unknown line>
  14: komorebi::ring::_::<impl serde::ser::Serialize for komorebi::ring::Ring<T>>::serialize::h29970e12371cb966
      at <unknown source file>:<unknown line>
  15: serde::ser::SerializeMap::serialize_entry::heb44dd17a95c5e15
      at <unknown source file>:<unknown line>
  16: tracing_core::event::Event::metadata::h139874a813b506bd
      at <unknown source file>:<unknown line>
  17: komorebi::process_command::<impl komorebi::window_manager::WindowManager>::read_commands::hc9a52a3a23f93b75
      at <unknown source file>:<unknown line>
  18: std::sys_common::backtrace::__rust_begin_short_backtrace::h391c5eb50f7238df
      at <unknown source file>:<unknown line>
  19: core::fmt::Write::write_fmt::h26f5cbaff2f4a2fe
      at <unknown source file>:<unknown line>
  20: alloc::boxed::{{impl}}::call_once<unknown>
      at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\library\alloc\src\boxed.rs:1575
  21: alloc::boxed::{{impl}}::call_once<unknown>
      at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\library\alloc\src\boxed.rs:1575
  22: std::sys::windows::thread::{{impl}}::new::thread_start<unknown>
      at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\/library\std\src\sys\windows\thread.rs:56
  23: BaseThreadInitThunk<unknown>
      at <unknown source file>:<unknown line>
  24: RtlUserThreadStart<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Run with RUST_BACKTRACE=full to include source snippets.
Warning: SpanTrace capture is Unsupported.
Ensure that you've setup a tracing-error ErrorLayer and the semver versions are compatible', komorebi\src\window.rs:57:54 panic.file="komorebi\\src\\window.rs" panic.line=57 panic.column=54
Aug 24 19:28:36.170  INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 527780 })}:focus_monitor{idx=0}: komorebi::window_manager: focusing monitor
Aug 24 19:28:36.176  INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 527780 })}:focus_window{idx=0}: komorebi::container: focusing window
Aug 24 19:28:36.181  INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 527780 })}:focus_container{idx=1}: komorebi::workspace: focusing container
Aug 24 19:28:36.189  INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 527780 })}: komorebi::process_event: processed: (hwnd: 527780, title: DevDocs API Documentation, exe: chrome.exe, class: Chrome_WidgetWin_1)
Aug 24 19:28:36.532  INFO process_event{event=MoveResizeEnd(SystemMoveSizeEnd, Window { hwnd: 527780 })}:focus_monitor{idx=0}: komorebi::window_manager: focusing monitor
Aug 24 19:28:36.533  INFO process_event{event=MoveResizeEnd(SystemMoveSizeEnd, Window { hwnd: 527780 })}: komorebi::process_event: resizing with mouse
Aug 24 19:28:36.534  INFO process_event{event=MoveResizeEnd(SystemMoveSizeEnd, Window { hwnd: 527780 })}:resize_window{direction=Up sizing=Decrease step=Some(938)}: komorebi::window_manager: resizing window
Aug 24 19:28:36.534  WARN process_event{event=MoveResizeEnd(SystemMoveSizeEnd, Window { hwnd: 527780 })}:resize_window{direction=Up sizing=Decrease step=Some(938)}: komorebi::window_manager: cannot resize container in this direction
Aug 24 19:28:36.535  INFO process_event{event=MoveResizeEnd(SystemMoveSizeEnd, Window { hwnd: 527780 })}:update_focused_workspace{mouse_follows_focus=false}: komorebi::window_manager: updating
Aug 24 19:28:36.535  INFO process_event{event=MoveResizeEnd(SystemMoveSizeEnd, Window { hwnd: 527780 })}: komorebi::process_event: processed: (hwnd: 527780, title: DevDocs API Documentation, exe: chrome.exe, class: Chrome_WidgetWin_1)
Aug 24 19:28:37.681  INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 3607882 })}:focus_monitor{idx=0}: komorebi::window_manager: focusing monitor
Aug 24 19:28:37.684  INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 3607882 })}:focus_window{idx=0}: komorebi::container: focusing window
Aug 24 19:28:37.687  INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 3607882 })}:focus_container{idx=0}: komorebi::workspace: focusing container
Aug 24 19:28:37.690  INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 3607882 })}: komorebi::process_event: processed: (hwnd: 3607882, title: PowerShell, exe: WindowsTerminal.exe, class: CASCADIA_HOSTING_WINDOW_CLASS)
Originally created by @crosstyan on GitHub (Aug 24, 2021). Originally assigned to: @LGUG2Z on GitHub. Using bc08e177a12974224e141d33301462ea626bb85e ![State](https://user-images.githubusercontent.com/49297668/130610016-4fdeb642-e514-4197-82ec-0296d08ae12b.gif) Step to reproduce: 1. maximize a window with `toggle-maximize` 2. open random window in the same workspace 3. close that maximized window 4. workspace doesn't get retiled and `komorebic state` is stuck Logs ``` Aug 24 19:27:08.614 INFO read_commands:process_command{ToggleMaximize}:toggle_maximize:maximize_window: komorebi::window_manager: maximizing windowj Aug 24 19:27:08.717 INFO read_commands:process_command{ToggleMaximize}:toggle_maximize:maximize_window:focus_container{idx=0}: komorebi::workspace: focusing container Aug 24 19:27:08.720 INFO read_commands:process_command{ToggleMaximize}:toggle_maximize:update_focused_workspace{mouse_follows_focus=false}: komorebi::window_manager: updating Aug 24 19:27:08.721 INFO read_commands:process_command{ToggleMaximize}: komorebi::process_command: processed Aug 24 19:27:10.170 INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 3607882 })}:focus_monitor{idx=0}: komorebi::window_manager: focusing monitor Aug 24 19:27:10.174 INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 3607882 })}:focus_window{idx=0}: komorebi::container: focusing window Aug 24 19:27:10.181 INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 3607882 })}:focus_container{idx=0}: komorebi::workspace: focusing container Aug 24 19:27:10.186 INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 3607882 })}: komorebi::process_event: processed: (hwnd: 3607882, title: PowerShell, exe: WindowsTerminal.exe, class: CASCADIA_HOSTING_WINDOW_CLASS) Aug 24 19:27:17.932 INFO read_commands:process_command{State}: komorebi::process_command: processed Aug 24 19:27:19.484 INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 1510166 })}:focus_monitor{idx=0}: komorebi::window_manager: focusing monitor Aug 24 19:27:19.619 ERROR komorebi::process_event: there is no window Aug 24 19:27:19.646 INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 3607882 })}:focus_monitor{idx=0}: komorebi::window_manager: focusing monitor Aug 24 19:27:19.648 INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 3607882 })}:focus_window{idx=0}: komorebi::container: focusing window Aug 24 19:27:19.651 INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 3607882 })}:focus_container{idx=0}: komorebi::workspace: focusing container Aug 24 19:27:19.654 INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 3607882 })}: komorebi::process_event: processed: (hwnd: 3607882, title: PowerShell, exe: WindowsTerminal.exe, class: CASCADIA_HOSTING_WINDOW_CLASS) Aug 24 19:27:21.532 ERROR read_commands:process_command{State}: komorebi: panicked at 'could not get window title: 0: Invalid window handle. (os error 1400) Location: /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\library\core\src\convert\mod.rs:538 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ⋮ 4 frames hidden ⋮ 5: komorebi::windows_api::WindowsApi::window_text_w::h10220e080a3e3564 at <unknown source file>:<unknown line> 6: <komorebi::window::Window as serde::ser::Serialize>::serialize::hb6affc9158897738 at <unknown source file>:<unknown line> 7: serde::ser::SerializeMap::serialize_entry::h9e780eff8698181d at <unknown source file>:<unknown line> 8: komorebi::workspace::_::<impl serde::ser::Serialize for komorebi::workspace::Workspace>::serialize::hed3005d319374c9a at <unknown source file>:<unknown line> 9: serde::ser::SerializeMap::serialize_entry::h14bbebaf36b11624 at <unknown source file>:<unknown line> 10: komorebi::ring::_::<impl serde::ser::Serialize for komorebi::ring::Ring<T>>::serialize::h587e8b5a3f561623 at <unknown source file>:<unknown line> 11: serde::ser::SerializeMap::serialize_entry::h0f87d5f2613be75b at <unknown source file>:<unknown line> 12: komorebi::monitor::_::<impl serde::ser::Serialize for komorebi::monitor::Monitor>::serialize::h8933ae57ded52645 at <unknown source file>:<unknown line> 13: serde::ser::SerializeMap::serialize_entry::h54cb280b1959a341 at <unknown source file>:<unknown line> 14: komorebi::ring::_::<impl serde::ser::Serialize for komorebi::ring::Ring<T>>::serialize::h29970e12371cb966 at <unknown source file>:<unknown line> 15: serde::ser::SerializeMap::serialize_entry::heb44dd17a95c5e15 at <unknown source file>:<unknown line> 16: tracing_core::event::Event::metadata::h139874a813b506bd at <unknown source file>:<unknown line> 17: komorebi::process_command::<impl komorebi::window_manager::WindowManager>::read_commands::hc9a52a3a23f93b75 at <unknown source file>:<unknown line> 18: std::sys_common::backtrace::__rust_begin_short_backtrace::h391c5eb50f7238df at <unknown source file>:<unknown line> 19: core::fmt::Write::write_fmt::h26f5cbaff2f4a2fe at <unknown source file>:<unknown line> 20: alloc::boxed::{{impl}}::call_once<unknown> at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\library\alloc\src\boxed.rs:1575 21: alloc::boxed::{{impl}}::call_once<unknown> at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\library\alloc\src\boxed.rs:1575 22: std::sys::windows::thread::{{impl}}::new::thread_start<unknown> at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633\/library\std\src\sys\windows\thread.rs:56 23: BaseThreadInitThunk<unknown> at <unknown source file>:<unknown line> 24: RtlUserThreadStart<unknown> at <unknown source file>:<unknown line> Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering. Run with RUST_BACKTRACE=full to include source snippets. Warning: SpanTrace capture is Unsupported. Ensure that you've setup a tracing-error ErrorLayer and the semver versions are compatible', komorebi\src\window.rs:57:54 panic.file="komorebi\\src\\window.rs" panic.line=57 panic.column=54 Aug 24 19:28:36.170 INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 527780 })}:focus_monitor{idx=0}: komorebi::window_manager: focusing monitor Aug 24 19:28:36.176 INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 527780 })}:focus_window{idx=0}: komorebi::container: focusing window Aug 24 19:28:36.181 INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 527780 })}:focus_container{idx=1}: komorebi::workspace: focusing container Aug 24 19:28:36.189 INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 527780 })}: komorebi::process_event: processed: (hwnd: 527780, title: DevDocs API Documentation, exe: chrome.exe, class: Chrome_WidgetWin_1) Aug 24 19:28:36.532 INFO process_event{event=MoveResizeEnd(SystemMoveSizeEnd, Window { hwnd: 527780 })}:focus_monitor{idx=0}: komorebi::window_manager: focusing monitor Aug 24 19:28:36.533 INFO process_event{event=MoveResizeEnd(SystemMoveSizeEnd, Window { hwnd: 527780 })}: komorebi::process_event: resizing with mouse Aug 24 19:28:36.534 INFO process_event{event=MoveResizeEnd(SystemMoveSizeEnd, Window { hwnd: 527780 })}:resize_window{direction=Up sizing=Decrease step=Some(938)}: komorebi::window_manager: resizing window Aug 24 19:28:36.534 WARN process_event{event=MoveResizeEnd(SystemMoveSizeEnd, Window { hwnd: 527780 })}:resize_window{direction=Up sizing=Decrease step=Some(938)}: komorebi::window_manager: cannot resize container in this direction Aug 24 19:28:36.535 INFO process_event{event=MoveResizeEnd(SystemMoveSizeEnd, Window { hwnd: 527780 })}:update_focused_workspace{mouse_follows_focus=false}: komorebi::window_manager: updating Aug 24 19:28:36.535 INFO process_event{event=MoveResizeEnd(SystemMoveSizeEnd, Window { hwnd: 527780 })}: komorebi::process_event: processed: (hwnd: 527780, title: DevDocs API Documentation, exe: chrome.exe, class: Chrome_WidgetWin_1) Aug 24 19:28:37.681 INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 3607882 })}:focus_monitor{idx=0}: komorebi::window_manager: focusing monitor Aug 24 19:28:37.684 INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 3607882 })}:focus_window{idx=0}: komorebi::container: focusing window Aug 24 19:28:37.687 INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 3607882 })}:focus_container{idx=0}: komorebi::workspace: focusing container Aug 24 19:28:37.690 INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 3607882 })}: komorebi::process_event: processed: (hwnd: 3607882, title: PowerShell, exe: WindowsTerminal.exe, class: CASCADIA_HOSTING_WINDOW_CLASS) ```
adam added the bug label 2026-01-05 14:47:44 +01:00
adam closed this issue 2026-01-05 14:47:44 +01:00
Author
Owner

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

This should be fixed in 05777c34b9; previously maximized (and monocle) windows were not being removed properly/at all. 🙈

@LGUG2Z commented on GitHub (Aug 24, 2021): This should be fixed in https://github.com/LGUG2Z/komorebi/commit/05777c34b9fcf5c5543f4af97aabedf141aae982; previously maximized (and monocle) windows were not being removed properly/at all. 🙈
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#21