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

Respect padding for Stage Manager #126

Open
1 task done
towerofnix opened this issue Mar 21, 2023 · 4 comments
Open
1 task done

Respect padding for Stage Manager #126

towerofnix opened this issue Mar 21, 2023 · 4 comments
Labels
bug Something isn't working enhancement New feature or request priority:low Suggestion Help me improve! wontfix This will not be worked on
Milestone

Comments

@towerofnix
Copy link

Before opening the issue, have you...?

  • Searched for existing issues

Is your feature request related to a problem? Please describe

When using Stage Manager, window previews/thumbnails are shown along the left screen edge (or right if the Dock is on the left). SlimHUD doesn't acknowledge this and just shows up over window previews.

Describe the solution you'd like

Respect the area allocated for Stage Manager (when active) just like for the Dock!

Describe alternatives you've considered

No real alternatives here.

Anything else?

Compare SlimHUD with Stage Manager and with Dock:

SlimHUD covering Stage Manager preview windows SlimHUD elegantly moving over past the Dock

BTW, thanks for your work on this app! It looks great and is super easy to use and configure!

@towerofnix towerofnix added enhancement New feature or request Suggestion Help me improve! labels Mar 21, 2023
@AlexPerathoner AlexPerathoner added bug Something isn't working priority:low labels Mar 21, 2023
@AlexPerathoner AlexPerathoner modified the milestones: v1.5.1, Backlog Mar 21, 2023
@AlexPerathoner
Copy link
Owner

Looked into this, but unfortunately couldn't find a way to detect if Stage Manager is currently active in macOS

@AlexPerathoner AlexPerathoner added the wontfix This will not be worked on label Mar 25, 2023
@towerofnix
Copy link
Author

It's pretty trivial with defaults:

# check stage manager: 0 or 1
defaults read com.apple.WindowManager GloballyEnabled

# enable stage manager
defaults write com.apple.WindowManager GloballyEnabled -bool true

# disable stage manager
defaults write com.apple.WindowManager GloballyEnabled -bool false

I'm not sure if there's a direct analogy for Swift, but the read command reacts to changes in Stage Manager right away, so forking a shell process should work anyway. (There's no poll/watch command for defaults unfortunately, so you might have to do some thinking outside the box to react to changes effectively. The terminal command takes about 0.1s to execute.)

@AlexPerathoner
Copy link
Owner

That allows to check if it's enabled in the settings only, not if it's currently being shown in the UI (which is what I'd need to know before showing the HUD).
What I couldn't find out is how to check if the stage manager UI is visible or not (which depends on the size and position of the frontmost window). Figuring that out would be too time consuming (and almost certainly way too resource intensive, too)

and imo quite confusing, too (what should happen in such a situation?):
image

@towerofnix
Copy link
Author

Gotcha, that makes sense. Or in this case where the window preview are even more covered:

Screenshot 2023-03-25 at 3 07 01 PM

Figuring that out would be too time consuming (and almost certainly way too resource intensive, too)

Agreed on time-consuming, not sure if it'd really be resource-intensive though. You only need to perform window checks when deciding where to position SlimHUD, and it's not computationally challenging math, and querying window positions shouldn't be a power draw.

My main concern is that you just might not be able to access that window info in the first place, i.e. the list of windows which are in the current set. After all, a window behind the focused one, within the same set, can also obscure the window thumbnails:

Screenshot 2023-03-25 at 3 11 43 PM

The same windows don't obscure Stage Manager window previews if they aren't part of the current set, i.e. some other app/set is brought to the front:

Screenshot 2023-03-25 at 3 12 53 PM

I don't think it would be too complicated to compute whether or not any given windows would cause thumbnails to hide, but I don't know if we can access the list of windows for the current set. And while I doubt it would be a significant power draw, I don't know that for sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request priority:low Suggestion Help me improve! wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants