8000 [BUG]: Cloaked windows not restoring on `stop`/`restore-windows` · Issue #925 · LGUG2Z/komorebi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[BUG]: Cloaked windows not restoring on stop/restore-windows #925

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

Closed
Cynosphere opened this issue Jul 26, 2024 · 5 comments
Closed

[BUG]: Cloaked windows not restoring on stop/restore-windows #925

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

Comments

@Cynosphere
Copy link

Describe the bug
Cloaked windows not restoring on stop/restore-windows until manually clicked on/alt-tabbed to.

Is it always force-quitting when stopping? When running stop it always outputs:

komorebi is still running, attempting to force-quit

Stop-Process -Name:komorebi -ErrorAction SilentlyContinue

Or is this a purely visual issue?

To Reproduce
Steps to reproduce the behavior:

  1. Open a couple windows
  2. Move some to another workspace
  3. Run komorebic stop
  4. Observe that the windows from the other workspace(s) did not appear
  5. Run komorebic restore-windows and observe nothing changing still

Expected behavior
The cloaked windows restore themselves

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
komorebi is running as and being started/stopped as administrator

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

It's possible that this is because the hidden SetCloak function is not compatible with with the build of Windows you are running. Some more info should be available if you run komorebic log in a separate terminal tab while trying to reproduce this.

@Cynosphere
Copy link
Author

It's possible that this is because the hidden SetCloak function is not compatible with with the build of Windows you are running.

Cloaking works fine when switching workspaces, its only when stopping that it fails.

Some more info should be available if you run komorebic log in a separate terminal tab while trying to reproduce this.

2024-07-26T19:06:37.951793Z  INFO process_command{Stop}: komorebi::process_command: received stop command, restoring all hidden windows and terminating process
2024-07-26T19:06:37.952096Z  INFO process_command{Stop}:restore_all_windows: komorebi::window_manager: restoring all hidden windows
2024-07-26T19:06:37.952599Z ERROR komorebi::process_command: The parameter is incorrect. (0x80070057)

komorebic restore-windows gives no output to the log.

@LGUG2Z
Copy link
Owner
LGUG2Z commented Jul 26, 2024

Relevant blobs:

SocketMessage::Stop => {
tracing::info!(
"received stop command, restoring all hidden windows and terminating process"
);
self.restore_all_windows()?;
if WindowsApi::focus_follows_mouse()? {
WindowsApi::disable_focus_follows_mouse()?;
}
std::process::exit(0)
}

It's possible that since cloak is working when switching workspaces, you may be getting a failure when remove_accent is called, because operating on accents is only supported on Windows 11+

pub fn restore_all_windows(&mut self) -> Result<()> {
tracing::info!("restoring all hidden windows");
let no_titlebar = NO_TITLEBAR.lock();
let known_transparent_hwnds = transparency_manager::known_hwnds();
for monitor in self.monitors_mut() {
for workspace in monitor.workspaces_mut() {
for containers in workspace.containers_mut() {
for window in containers.windows_mut() {
if no_titlebar.contains(&window.exe()?) {
window.add_title_bar()?;
}
if known_transparent_hwnds.contains(&window.hwnd) {
window.opaque()?;
}
window.remove_accent()?;
window.restore();
}
}
}
}
Ok(())
}

If you're able to build from source, can you try commenting out that line and recompiling?

LGUG2Z added a commit that referenced this issue Jul 26, 2024
This commit ensures that the "Komorebi" border implementation is set as
the default as it has the maximum range of compat across different
Windows versions, whereas the "Windows" implementation requires Win 11.

Because "Windows" implementation methods will error on Windows 10,
restore_all_windows has been updated to only attempt to remove accents
if BorderImplementation::Windows is selected (this is gated behind the
WINDOWS_11 check).

re #925
@Cynosphere
Copy link
Author

Works as intended with that commented out.

@LGUG2Z
Copy link
Owner
LGUG2Z commented Jul 26, 2024

Fix is referenced above, will be in the next nightly released to WinGet over the weekend 🎉

@LGUG2Z LGUG2Z closed this as completed Jul 26, 2024
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
0