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

Sketchybar won't display on notched displays above fullscreen windows #594

Open
NeilS-95 opened this issue Aug 7, 2024 · 4 comments
Open

Comments

@NeilS-95
Copy link

NeilS-95 commented Aug 7, 2024

Is it possible to get Sketchybar to display above native fullscreen windows specifically on displays with a notch? I noticed this issue #383 where it's stated that support for drawing sketchybar over fullscreen windows would block UI elements of the app and therefore it's intended behaviour to not draw the bar over top. However on notched displays the macOS menu bar can be displayed above fullscreen apps without interfering with UI elements. Would it be possible to show sketchybar in the black bar where the notch is when in native fullscreen?

@lsgalante
Copy link

I also would find this to be useful. I tried to look at the code and investigate the KCGSSuperStickyTagBit but it doesn't appear to be present in the code anymore. Not sure if this has to do with changes in the API after some mac os release version. It would be really helpful to get any pointers about where to look to try to implement this, if he is not planning on adding the feature himself.

@FelixKratz
Copy link
Owner

If the bar is set to be sticky, it would always shows on all workspaces, even fullscreen ones if it where not for this line which decides to hide the bar on fullscreen spaces:

bar_manager->bars[i]->shown = SLSSpaceGetType(g_connection, dsid) != 4;

The way this works without the kCGSSuperStickyTagBit is that we create a new space on an application level, which we place all our windows in:

SketchyBar/src/window.c

Lines 61 to 69 in fb59232

g_space = SLSSpaceCreate(g_connection, 1, 0);
SLSSpaceSetAbsoluteLevel(g_connection, g_space, 0);
CFArrayRef space_list = cfarray_of_cfnumbers(&g_space,
sizeof(uint32_t),
1,
kCFNumberSInt32Type);
SLSShowSpaces(g_connection, space_list);
CFRelease(space_list);

This space is completely decoupled from the native system spaces (which is why it is stationary on system space change).

@lsgalante
Copy link

This is really wonderful, thank you. Your method of creating a new space is interesting. I was able to make it work with sticky=on and topmost=on after removing the line you pointed out. This gets in the way of the mac os menu bar, but I think there is an easy fix for that by setting the z index. I really appreciate your help.

@lsgalante
Copy link

I couldn't find a CGWindowLevelKey which causes a window to appear above full screen apps and below the menu bar. I think I have seen someone do this but I am not certain. For now I have a key binding set to toggle sketchybar visibility, which works great.

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

No branches or pull requests

3 participants