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

space_windows_change's APPS include hidden/minimized windows? #492

Closed
shajra opened this issue Jan 25, 2024 · 2 comments
Closed

space_windows_change's APPS include hidden/minimized windows? #492

shajra opened this issue Jan 25, 2024 · 2 comments
Labels
available on master bug Something isn't working

Comments

@shajra
Copy link

shajra commented Jan 25, 2024

The space_window_change trigger provides the APPS variable, which helps render app icons in SketchyBar's spaces.

That seems to work pretty well, though there are some gaps. One gap remaining is with respect to both hiding and minimizing windows. This is kind of unavoidable with Macs because sometimes closing a window closes the application, and other times, it just hides the window. Electron apps like Discord and Slack do this kind of hiding.

What happens now is when a window is hidden/minimized, Sketchybar gets no notification that it's been hidden/minimized. If, in the same space, you create a new window, a trigger is sent that excludes the hidden window from the APPS list. If you move to another space, the inconsistent state will continue in the space with the problem. This doesn't render app icons completely useless, but it can be annoying if you actually look at icons to think about what space to go to.

For now, I've done things like writing skhd keybind captures of Cmd + h so that I can properly remove applications that aren't visible when hiding from SketchyBar and then delegate the actual hiding via an AppleScript.

That does the right thing when hiding. But I end up having the reverse problem when unhiding, which I don't have even a workaround for yet.

It occurred to me that it might be easier to just let the APPs variable include hidden windows. Then there would be nothing to either remove or add.

And for me personally, I actually like that, because minimizing/ hiding isn't about making the application be so out of view I forget about it. It just needs to not be in the way of window management.

What do you think?

@shajra shajra changed the title space_windows_change's APPS include hidden windows? space_windows_change's APPS include hidden/minimized windows? Jan 25, 2024
@FelixKratz FelixKratz added the bug Something isn't working label Jan 26, 2024
@FelixKratz
Copy link
Owner

This is also something that is bothering me so I will work on it as soon as I have some time. The current implementation of the tracking of app windows is too naive to be able to handle hidden windows properly, but it is easy to make it work with hidden windows as well. Possibly, we could extend the event payload a bit to include a field with the hidden apps on a space.

@FelixKratz
Copy link
Owner

Ok, so I think this commit should fix the problem: a16906a
I am keeping track of the hidden windows separately and it would be possible to add this info to another field in the event.

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

No branches or pull requests

2 participants