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

Bar not sticky on space change #493

Closed
aashish2057 opened this issue Jan 27, 2024 · 24 comments
Closed

Bar not sticky on space change #493

aashish2057 opened this issue Jan 27, 2024 · 24 comments
Labels
available on master bug Something isn't working

Comments

@aashish2057
Copy link

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
@aashish2057
Copy link
Author

aashish2057 commented Jan 27, 2024

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.

@FelixKratz
Copy link
Owner

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

@FelixKratz FelixKratz added the bug Something isn't working label Jan 27, 2024
@FelixKratz FelixKratz changed the title bar blinking even with sticky=on Bar not sticky on space change Jan 27, 2024
@aashish2057
Copy link
Author

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": [

        ]
}

@FelixKratz
Copy link
Owner

Try to update to v2.20.0

@aashish2057
Copy link
Author

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

@rhh4x0r
Copy link

rhh4x0r commented Jan 31, 2024

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

@FelixKratz
Copy link
Owner

FelixKratz commented Jan 31, 2024

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

@aashish2057
Copy link
Author

aashish2057 commented Jan 31, 2024

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": [

        ]
}

@FelixKratz
Copy link
Owner

FelixKratz commented Jan 31, 2024

  • 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.

@aashish2057
Copy link
Author

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

@FelixKratz
Copy link
Owner

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;
}

@rhh4x0r
Copy link

rhh4x0r commented Jan 31, 2024

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

@aashish2057
Copy link
Author

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?

@aashish2057
Copy link
Author

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

@aashish2057
Copy link
Author

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

@FelixKratz
Copy link
Owner

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.

@aashish2057
Copy link
Author

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.

@FelixKratz
Copy link
Owner

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.

@FelixKratz
Copy link
Owner

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.

@aashish2057
Copy link
Author

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

@aashish2057
Copy link
Author

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

@FelixKratz
Copy link
Owner

FelixKratz commented Feb 1, 2024

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.

@JoseVarelaP
Copy link

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

@aashish2057
Copy link
Author

Yep can also confirm it is now working

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

4 participants