FelixKratz / JankyBorders

A lightweight window border system for macOS
GNU General Public License v3.0
1k stars 18 forks source link

MacOS shadow appears above border #37

Closed jaybonthius closed 8 months ago

jaybonthius commented 8 months ago

The MacOS shadow is appearing above the border which results in a much darker border color. Is there a way to force the border to appear above the shadow?

I'd love to disable the shadows with Yabai, but I cannot disable SIP on my computer.

FelixKratz commented 8 months ago

There likely nothing we can do about that without injecting into system processes (which yabai does with the scripting addition). The border is currently drawn below the window, so the compositor (WindowServer) is drawing the window shadow correctly on the border. If we would draw the border above the window, this would not be a problem, however, there are several other technical reasons why I am not sure this is the way to go.

januz commented 8 months ago

@FelixKratz I am very grateful that you developed this tool but came here to ask about the shadows interfering with the border as well. In my setup, it's especially confusing because I have window decoration disabled in kitty, so kitty windows are shown with a light colored border (how the borders look like when using yabai and disabling SIP) while for all other windows the border is much darker.

I was wondering whether borders could be drawn above instead of below the windows which seems like a nice way to "disable" the shadows without needing to disable SIP. What are the reasons why you don't think that this would be possible/wise? Thank you!

FelixKratz commented 8 months ago

I have added an experimental option to order the border above the window with the configuration option:

borders order=above

the default is below. This is for testing purposes, however, some problems include but are not limited to:

MatthiasGrandl commented 8 months ago

just installed. there is another issue. I am typing this right now on firefox with order=above and on every keystroke the border is flickering. other than that and the caveats you mentioned, it seems to work!

FelixKratz commented 8 months ago

I have added this to the list of problems that are produced by ordering the border above the window. I am leaving this experimental option in for some time to see if someone wants to invest some time and effort into solving some of the problems. I will probably remove this option before the next release while these severe limitations exist.

januz commented 8 months ago

@FelixKratz Thanks so much for implementing this experimental feature! I just activated it a few minutes ago (so haven't done any in-depth testing) but so far it works perfectly for me. I don't experience any issues with resizing or flickering and, as expected, the border looks a lot nicer!

I'll keep this option on and will let you know if something weird comes up while I'm going through a normal work day. What are the issues that I should look out for specifically? I'm not using Firefox (I don't see the flickering issue while typing this in Arc Browser). I typically do the resizing of windows with my keyboard instead of the mouse but also the mouse seems to work.

I am currently not using yabai but testing aerospace as my tiling window manager (don't know whether this is relevant).

I am leaving this experimental option in for some time to see if someone wants to invest some time and effort into solving some of the problems. I will probably remove this option before the next release while these severe limitations exist.

If I continue to experience no issues, would you mind keeping it either as a "hidden" option or an official one and pointing out the (potential) drawbacks? Thank you!

jaybonthius commented 8 months ago

Chiming in to say this is working great on my end! Thanks a bunch. Seconding @januz, would love to continue having this as an experimental option.

januz commented 8 months ago

@FelixKratz Just an update—I'm still not experiencing any issues with the order=above option. It's working great!

Write commented 8 months ago

Hi, I'm new to using this tool.

I just wanted to point out that order=above also fix the lagginess when using a tool like BetterSnapTool to move the windows with a Keyboard Shortcut + moving the mouse.

oder=above is really a nice option. Thanks !

EDIT : Maybe i'm wrong, i've just restarted the services w/ order=below, and I don't have any lag anymore either.

FelixKratz commented 8 months ago

I will keep this option as an unsupported and undocumented option. If order=above and style=square and width=8.0 or larger, the square borders are truly square as well.