FelixKratz / SketchyBar

A highly customizable macOS status bar replacement

Home Page:https://felixkratz.github.io/SketchyBar/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bar not sticky on space change

aashish2057 opened this issue · comments

Really want to use this but the bar keeps blinking and settings sticky doesn't fix it. I attached a recording of the blinking.

The result of running sketchybar --query bar

{
        "position": "top",
        "topmost": "off",
        "sticky": "on",
        "hidden": "off",
        "shadow": "off",
        "font_smoothing": "off",
        "blur_radius": 30,
        "margin": 0,
        "drawing": "on",
        "color": "0xff101314",
        "border_color": "0xffff0000",
        "border_width": 0,
        "height": 32,
        "corner_radius": 0,
        "padding_left": 10,
        "padding_right": 10,
        "y_offset": 0,
        "clip": 0.000000,
        "image": {
                "value": "(null)",
                "drawing": "off",
                "scale": 1.000000
        },
        "items": [
                 "space.1",
                 "space.2",
                 "space.3",
                 "space.4",
                 "space.5",
                 "space.6",
                 "space.7",
                 "space.8",
                 "space.9",
                 "space.10",
                 "space_separator",
                 "front_app",
                 "clock",
                 "volume",
                 "battery"
        ]
}

sketchybar.blinking.mp4

I noticed this issue #220 , that suggested on sonoma we can use sticky=on to prevent the flickering, I am on Sonoma 14.2.1 still having this issue. I saw @ralphptorres not have this issue when not using yabai with sip on sonoma so curious if anyone knows what I could be doing wrong. I am confused because the sketchybar docs suggest to only use this with animations disabled, something that you can only do with yabai and sip disabled, but hoping there is a way to do it without that as I run yabai with sip enabled.

On Sonoma, the sticky property should not be needed anymore, it is interesting that your bar flickers on space change, can you try with this minimal sketchybarrc and report if the problem persists?

sketchybarrc:

sketchybar --bar height=40 color=0xffffffff sticky=on

yeah same problem still flickering

{
        "position": "top",
        "topmost": "off",
        "sticky": "on",
        "hidden": "off",
        "shadow": "off",
        "font_smoothing": "off",
        "blur_radius": 0,
        "margin": 0,
        "drawing": "on",
        "color": "0xffffffff",
        "border_color": "0xffff0000",
        "border_width": 0,
        "height": 40,
        "corner_radius": 0,
        "padding_left": 20,
        "padding_right": 20,
        "y_offset": 0,
        "clip": 0.000000,
        "image": {
                "value": "(null)",
                "drawing": "off",
                "scale": 1.000000
        },
        "items": [

        ]
}

Try to update to v2.20.0

Updated to version 2.20.0 still same flickering with the minimal sketchybar as well

commented

Just came across sketchybar for the first time and I'm getting flickering as well between space changes. Tried with sticky on and off, otherwise just default config.

Ventura 13.3.1

I think with "Reduced Motion" there is nothing we can do about the flickering. But if thats not activated the windows should be on all spaces at the same time.

Could you test the current master and see if anything has changed about this problem (on Sonoma):

brew uninstall sketchybar
brew install sketchybar --head
brew services restart sketchybar

and then after testing go back to lastest release with:

brew uninstall sketchybar
brew install sketchybar
brew services restart sketchybar

Just tested this with brew install sketchybar --head and still facing the same problem. Also I do not have "Reduce Motion" enabled. Let me know if you need any other details, want to help figure this out so I can start using sketchybar.

{
        "position": "top",
        "topmost": "off",
        "sticky": "on",
        "hidden": "off",
        "shadow": "off",
        "font_smoothing": "off",
        "blur_radius": 0,
        "margin": 0,
        "drawing": "on",
        "color": "0xffffffff",
        "border_color": "0xffff0000",
        "border_width": 0,
        "height": 40,
        "corner_radius": 0,
        "padding_left": 20,
        "padding_right": 20,
        "y_offset": 0,
        "clip": 0.000000,
        "image": {
                "value": "(null)",
                "drawing": "off",
                "scale": 1.000000
        },
        "items": [

        ]
}
  • Are you using any other tools which modify the way spaces/space animations etc. work?
  • Are you using a window manager?
  • Do you have SIP disabled?

It seems sketchybar registers its windows as being sticky but for some reason the WindowServer does not respect this. So there has to be some special (rare) condition which causes this and I think it will have something to do with another system feature, because I am not able to properly reproduce this problem on my machine.

  • I don't use anything that modifies spaces/space animations that I am aware of
  • I am using Yabai
  • SIP is not disabled

Ok that doesn't sound problematic at all... I will think a bit more about this problem, maybe I can come up with a solution. If you want and feel confident, you could try to check if the control flow reaches these lines (which are the ones that make the window sticky):

SketchyBar/src/window.c

Lines 29 to 32 in 7d121d5

if (g_bar_manager.sticky) {
set_tags |= kCGSStickyTagBit;
clear_tags = kCGSSuperStickyTagBit;
}

commented

Turning off Reduce motion worked for me. I also installed the head version with that as well.

Ok that doesn't sound problematic at all... I will think a bit more about this problem, maybe I can come up with a solution. If you want and feel confident, you could try to check if the control flow reaches these lines (which are the ones that make the window sticky):

SketchyBar/src/window.c

Lines 29 to 32 in 7d121d5

if (g_bar_manager.sticky) {
set_tags |= kCGSStickyTagBit;
clear_tags = kCGSSuperStickyTagBit;
}

Not sure if I know how to do this, sorry if its a dumb question how would I check if the control flow reaches those lines?

I am not sure if I did this right but attached a debugger and looks like it went inside the if statement?
Screenshot 2024-01-31 at 4 49 38 PM

I tried on another machine and got the same flickering issue, not sure what I am doing wrong

Could you maybe try to create a new user account on your mac where you try to run sketchybar? This way we will be able to determine if it is a software configuration issue (because the new account will have default settings) or a more general issue.

Made a new user account, all default settings didn't do anything other than install brew before installing sketchybar, used the minimal sketchybar and on space switch got the same flickering.

Ok, so I think I can now reproduce this problem. It is a bit subtle. The important part here is how exactly the spaces are changed. If the space is changed via a gesture on the trackpad, the sticky property works just as expected. If the space is changed via the keyboard shortcut "Move left a space" and "Move right a space" in "System Settings" -> "Keyboard Shortcuts" -> "Mission Control" -> "Mission Control" the sticky property also works as expected. However, if the keyboard shortcuts for "Switch to Desktop X" are used then there is flickering if the space change animations are enabled. For me those animations are disabled using yabai, which is why I could not reproduce the problem.

There is a way to make the bar completely sticky on space change, i.e. it does not move at all during the space change animation. Maybe this would be a more robust approach.

wow you are right I just tested this, I always use the mission control "switch to desktop x" to switch spaces and it flickers on that but I just tried it with "move left" and "move right" and there is no flickering at all

There is a way to make the bar completely sticky on space change, i.e. it does not move at all during the space change animation. Maybe this would be a more robust approach.

This would be awesome

Check it out (6801874):

brew uninstall sketchybar
brew install sketchybar --head
brew services restart sketchybar

and once you want to go back to the current stable release (or the next one) run:

brew uninstall sketchybar
brew install sketchybar
brew services restart sketchybar

It would be very appreciated to get some testing done with this new way to draw the bar.

You need to enable the sticky property for it to use the new sticky feature.

Hoping in to give this new patch a try, and yeah. Can confirm it now works with the "Switch To Desktop X" shortcuts. Doing this on "Reduced Motion" does still present the flicker problem but I'm not sure what can be done about that one.

Grabacion.de.pantalla.2024-02-01.a.la.s.12.02.22.p.m.mp4

Yep can also confirm it is now working