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

Displays have separate Spaces #495

Open
FelixKratz opened this issue Jan 27, 2024 · 8 comments
Open

Displays have separate Spaces #495

FelixKratz opened this issue Jan 27, 2024 · 8 comments

Comments

@FelixKratz
Copy link
Owner

Since v2.20.0 SketchyBar will refuse to start if the system settings "Displays have separate Spaces" is turned off. The macOS default is that this option is turned on and it is required for certain things to work properly.

The setting is located in System Settings -> Desktop & Dock -> Displays have separate Spaces and should be on.

@FancyFurret
Copy link

FancyFurret commented Jul 20, 2024

@FelixKratz This unfortunately makes it impossible for me to use SketchyBar. I have a bit of a unique scenario - I have an ultrawide monitor (32:9), that in order to make the full resolution and refresh rate work with my macbook - I have to run in "Picture by Picture" mode. Meaning the monitor acts as two 16:9 displays side by side to macos. Now, in order to have windows across this middle "seam" without part of the window getting cut off, I have to disable "Displays have separate Spaces".

It would be fantastic if SketchyBar could support this configuration (even better if we could make it so the bar can span multiple displays, so I could have one long bar spanning the full width of my ultrawide monitor, broken up into two displays in macos) (this is a pain point with macos's native bar, it only shows up on one display, ie: half of my full ultrawide monitor)

@incanus
Copy link

incanus commented Aug 4, 2024

Related to this, I'm using SketchyBar with AeroSpace WM and they recently began recommending turning this setting off.

https://nikitabobko.github.io/AeroSpace/guide#a-note-on-displays-have-separate-spaces

I only found out when I logged out/in to toggle the setting and SketchyBar wouldn't come up, then I tried it manually and got the error message.

Just an FYI / linking the info for context.

@diogox
Copy link

diogox commented Aug 4, 2024

Came here to say the same thing as @incanus.

Can this restriction be removed? Will have to use something else otherwise :(

@FelixKratz
Copy link
Owner Author

FelixKratz commented Aug 5, 2024

I am all for supporting this configuration. If I remember correctly, there where some issues with this configuration

  • This function always return the main display:

    SketchyBar/src/display.c

    Lines 137 to 139 in c713afe

    static CFStringRef display_active_display_uuid(void) {
    return SLSCopyActiveMenuBarDisplayIdentifier(g_connection);
    }
  • The event NSWorkspaceActiveDisplayDidChangeNotification is not fired.
  • The spaces component likely needs some work, because it also assumes that displays have separate spaces. Apart from that most other things are unaffected (see Mouse click event not captured on unfocused displays #392 (comment)).

That being said, I took the lazy route back then and simply assumed no one would really need that setting disabled, hence I did not feel like putting the effort required to create a workaround solution and put in the check on startup (and also because yabai will not start with this option disabled as well):

SketchyBar/src/sketchybar.c

Lines 200 to 202 in c713afe

if (SLSGetSpaceManagementMode(g_connection) != 1) {
error("%s: 'System Settings' -> 'Desktop & Dock' -> 'Displays have separate spaces' needs to be enabled for sketchybar to work properly.\n", g_name);
}

But if there is significant demand then it might be time to put this back on the agenda because there definitely is a way to make it work with a bit of effort.

What is needed is the following:

  • A new way to get notified of the active display other than using NSWorkspaceActiveDisplayDidChangeNotification.
  • A new function to determine the active display id.

@diocletiann
Copy link

works again, thanks!

@FelixKratz
Copy link
Owner Author

This is my first shot at it: fb59232
everything seems to work at a first glance. I would appreciate help testing this commit. There is still some work required to get it ready for a release.

@PhrantiK
Copy link

PhrantiK commented Aug 6, 2024

Unrelated but in the neighbourhood - #213 (comment)

@bassamsdata
Copy link

@incanus @diogox Would you mind sharing your SketchyBar configuration for Aerospace? I've been trying to set it up but haven't had any luck so far.

Thank you in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants