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

Default menu items disappears from sketchybar #341

Closed
lokxii opened this issue Mar 15, 2023 · 5 comments
Closed

Default menu items disappears from sketchybar #341

lokxii opened this issue Mar 15, 2023 · 5 comments
Labels
available on master bug Something isn't working

Comments

@lokxii
Copy link

lokxii commented Mar 15, 2023

Default menu items sometimes disappears from sketchybar. Although I notice it mostly after switching spaces, I believe its not the only time when the items disappears.

@FelixKratz
Copy link
Owner

I have noticed this too. It has something to do with the animations in macOS. When I disable those animations (with yabai) the aliases do not disappear anymore.

I think it could be that I have to check if the display is animating before capturing the surface of the default bar item.

@FelixKratz FelixKratz added the bug Something isn't working label Mar 15, 2023
@FelixKratz
Copy link
Owner

FelixKratz commented Mar 15, 2023

Hmm, so it seems that calling

extern void SLSCaptureWindowsContentsToRectWithOptions(uint32_t cid, uint64_t* wid, uint32_t count, CGRect bounds, uint32_t flags, CGImageRef* image);

during a system animation leaves the macOS bar windows in a state where their surfaces can not be captured again until another event updates them (e.g. another space change or revealing the macOS bar). This can be mitigated by choosing a higher alias.update_freq or by disabling the system animations.

@lokxii
Copy link
Author

lokxii commented Mar 15, 2023

I've set alias.update_freq=1 and the items doesn't seem to disappear (or at least I haven't notice it). Sketchybar doesn't seem to use much resources because of this so I will just stick with this solution. Thank you for your response :)

@FelixKratz
Copy link
Owner

I think alias.update_freq=5 will reduce the probability of this happening on space change, while alias.update_freq=1 is default. I will have to look for a way to detect these animations…

@FelixKratz
Copy link
Owner

I think this commit should fix it: 2f01d41

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