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]: Breakage if Explorer has been restarted with taskkill or crashes #924

Open
Cynosphere opened this issue Jul 26, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@Cynosphere
Copy link

Cynosphere commented Jul 26, 2024

Describe the bug
Switching workspaces via taskbar breaks if Explorer has been restarted while komorebi is running.

To Reproduce
Steps to reproduce the behavior:

  1. Open a couple windows
  2. Move some to another workspace
  3. Restart Explorer
  4. Try to navigate to a window on a workspace that isn't the current one

Observed behavior
The selected window shows up on the current workspace and the selected border becomes unresponsive.
Switching workspaces still works and everything existing will be tiled properly. New windows do not get tiled.

Only way to fix is to stop and restart komorebi.

Expected behavior
Selecting the window takes you to the workspace it is on and the border doesn't become unresponsive.

Operating System

OS Name:                   Microsoft Windows 10 Home
OS Version:                10.0.19045 N/A Build 19045

komorebic check Output

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

Looking for configuration files in C:\Users\User

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

Found C:\Users\User\.config\whkdrc; key bindings will be loaded from here when whkd is started, and you can start it automatically using the --whkd flag

Additional context
N/A

@Cynosphere Cynosphere added the bug Something isn't working label Jul 26, 2024
@Cynosphere
Copy link
Author

It only seems to be breaking when using the context menu entry from Winaero Tweaker, since that calls cmd to run taskkill and then launch it.

komorebic log output:

2024-07-26T19:10:40.151490Z ERROR komorebi::process_event: there is no container/window
2024-07-26T19:10:40.168399Z  INFO process_event{event=Show(ObjectShow, Window { hwnd: 29888088, animation: Animation { hwnd: 29888088 } })}:focus_window{idx=0}: komorebi::container: focusing window
2024-07-26T19:10:40.170116Z  INFO process_event{event=Show(ObjectShow, Window { hwnd: 29888088, animation: Animation { hwnd: 29888088 } })}:focus_container{idx=1}: komorebi::workspace: focusing container
2024-07-26T19:10:40.173032Z  INFO process_event{event=Show(ObjectShow, Window { hwnd: 29888088, animation: Animation { hwnd: 29888088 } })}:update_focused_workspace{follow_focus=false trigger_focus=false}: komorebi::window_manager: updating
2024-07-26T19:10:40.313078Z  INFO process_event{event=Show(ObjectShow, Window { hwnd: 29888088, animation: Animation { hwnd: 29888088 } })}: komorebi::process_event: processed: (hwnd: 29888088, title: C:\Windows\system32\cmd.exe, exe: cmd.exe, class: ConsoleWindowClass)
2024-07-26T19:10:40.422351Z  INFO process_event{event=TitleUpdate(ObjectNameChange, Window { hwnd: 29888088, animation: Animation { hwnd: 29888088 } })}: komorebi::process_event: processed: (hwnd: 29888088, title: 
C:\Windows\system32\cmd.exe, exe: cmd.exe, class: ConsoleWindowClass)
2024-07-26T19:10:40.727205Z  INFO process_event{event=FocusChange(SystemForeground, Window { hwnd: 10950080, animation: Animation { hwnd: 10950080 } })}:focus_window{idx=0}: komorebi::container: focusing window    
2024-07-26T19:10:40.730750Z ERROR process_event{event=FocusChange(SystemForeground, Window { hwnd: 10950080, animation: Animation { hwnd: 10950080 } })}: komorebi: panicked at komorebi\src\com\mod.rs:48:90:        
called `Result::unwrap()` on an `Err` value: Error { code: HRESULT(0x80040154), message: "Class not registered" } panic.file="komorebi\\src\\com\\mod.rs" panic.line=48 panic.column=90
2024-07-26T19:10:41.101634Z  INFO focus_window{idx=0}: komorebi::container: focusing window
2024-07-26T19:10:41.101901Z  INFO focus_container{idx=0}: komorebi::workspace: focusing container
2024-07-26T19:10:41.102128Z  INFO focus_window{idx=0}: komorebi::container: focusing window
2024-07-26T19:10:41.102328Z  INFO focus_container{idx=0}: komorebi::workspace: focusing container
2024-07-26T19:10:41.130517Z  INFO komorebi::reaper: reaped 2 orphan window(s) and 0 orphaned container(s) on monitor: 0, workspace: 0

Restaring Explorer through Task Manager or Process Hacker doesn't cause any breakage.

@Cynosphere Cynosphere changed the title [BUG]: Switching workspaces via taskbar breaks if Explorer has been restarted [BUG]: Breakage if Explorer has been restarted with taskkill or crashes Jul 26, 2024
@LGUG2Z
Copy link
Owner

LGUG2Z commented Jul 27, 2024

I don't actually understand any of the code in this module or how COM works 😅

// This code is largely taken verbatim from this repository: https://github.com/Ciantic/AltTabAccessor
// which the author Jari Pennanen (Ciantic) has kindly made available with the MIT license, available
// in full here: https://github.com/Ciantic/AltTabAccessor/blob/main/LICENSE.txt

I'm guessing that these class registrations are tied to specific instances of explorer.exe. I'll leave this open if anyone wants to dig, but I guess the general guidance should be that if you restart explorer.exe, you should also restart komorebi.exe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants