mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
Maximized window conflict with applications identified as tray application #14
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @crosstyan on GitHub (Aug 18, 2021).
Originally assigned to: @LGUG2Z on GitHub.
komorebi
0725549d45will stuck after closing an application identified withidentify-tray-applicationwhen there's a maximized window (maximized withtoggle-maximize) in workspace.Step to reproduce:
identify-tray-applicationtoggle-maximizeSuggestion: maybe a maximized window should be treated as a kind of
monocle_container, As I described in #12. That is, a maximized window should have the highest priority (like pinned down at the top) as monocle layout.Here are the logs
@LGUG2Z commented on GitHub (Aug 19, 2021):
I'm able to reproduce this; there is no panic, so I think that this is a case of a deadlock with multiple attempts to access one of the same global state holders.
From the logs, it looks like it is probably this call that triggers the deadlock.
I have done a quick grep and I think that this actually doesn't need to be a global static and can be part of the
WindowManagerstruct; I'll try refactoring this tomorrow and see if that helps avoid the deadlock. 🙏@LGUG2Z commented on GitHub (Aug 19, 2021):
My hunch was right, the lock on
HIDDEN_HWNDSis still held by theWindowManagerEvent::Hide ( .. )handler inprocess_event.rs, so whenwindow.maximize()gets called in the final part of the same handler, and tries to obtain the same lock, it results in a deadlock which makeskomorebi.exeunresponsive.I was able to track down the deadlock by swapping out
std::sync::Mutexwithparking_lot::Mutexfrom theparking_lotcrate and running this deadlock detector in a separate thread:I'm going to spend some time evaluating whether I should swap out
std::sync::Mutexfor the implementation in that crate, and seeing if I can ship the deadlock detection inkomorebi.exebinaries and have it integrate nicely with the current approach to logging.@LGUG2Z commented on GitHub (Aug 19, 2021):
@crosstyan Try building from https://github.com/LGUG2Z/komorebi/tree/hotfix/hidden-hwnds-deadlock with
cargo install --locked --path komorebi --features deadlock_detection- I have tried reproducing the issue above a number of times on this commit and so far I haven't seen the issue again. 🤞@crosstyan commented on GitHub (Aug 19, 2021):
Looks good to me! That's really fast!
@crosstyan commented on GitHub (Aug 19, 2021):
@LGUG2Z By the way, is it intended to differentiate
toggle-monoclefromtoggle-maximizeby allowing window to pop up on a maximized window intoggle-maximize? I'm satisfied with the result but I wonder how you design these things.@LGUG2Z commented on GitHub (Aug 19, 2021):
@crosstyan for
toggle-maximizeand anything else that links in to native Windows functionality, I just aim to respect as much as possible the native system behaviour.