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

[Enhancement] yabai padding issue #2502

Open
aspauldingcode opened this issue Dec 23, 2024 · 5 comments
Open

[Enhancement] yabai padding issue #2502

aspauldingcode opened this issue Dec 23, 2024 · 5 comments
Labels
addressed on master; not released Fixed upstream, but not yet released

Comments

@aspauldingcode
Copy link

aspauldingcode commented Dec 23, 2024

yabai version irrelevent, happened since 6.x.x, still happening on 7.1.5
macOS version irrelevent, happened since 13.x.x, still happening on 15.0.0
Yabai on macOS has an issue with the gaps.
if you pay really close attention, the spacing on gaps on the left side is correct. the spacing on the right is incorrect. yabai makes the workspace right-side have more space than it should.
Screenshot 2024-12-23 at 12 14 59 PM
Look at the left gap, then the right gap. edges of the window.

I am using this config:

top_padding = 15;
bottom_padding = 15;
left_padding = 15;
right_padding = 15;
window_gap = 15;

however, looking closely at the image, we see that it doesn't matter, the right side has more gap than the left.
Here is another example, just one window:
Screenshot 2024-12-23 at 12 17 10 PM

@aspauldingcode aspauldingcode changed the title [Enhancement [Enhancement] yabai gap issue Dec 23, 2024
@aspauldingcode aspauldingcode changed the title [Enhancement] yabai gap issue [Enhancement] yabai padding issue Dec 23, 2024
@aspauldingcode
Copy link
Author

here is a capture of left/right with 15 pixels padding.. I will take a capture at 16 pixels.
notice how the main window border won't even be captured on the right. I use the sketchybar program at the top in comparison.
Screenshot 2024-12-23 at 12 22 37 PM
Screenshot 2024-12-23 at 12 22 46 PM

running a line vertically in a photo editing tool, it might be easier to see how it is one pixel off at least on the right side.

I will use non-shadow, sharp-corner application "alacritty" to try representing better. I will set the gaps, and the padding to 1px on all sides to represent the extra space better. compare to sketchybar/ edges:
Screenshot 2024-12-23 at 12 25 28 PM

Screenshot 2024-12-23 at 12 25 34 PM Screenshot 2024-12-23 at 12 25 43 PM

This issue is extremely hard to show, but it's bothering me on HighDPI retina display.

@koekeishiya
Copy link
Owner

koekeishiya commented Jan 7, 2025

Maybe I'm not thinking clearly and my math is wrong, but lets say built-in macOS notched-display on M1 macbook with resolution set to 1800x1169.

1800 - left padding (15) - right padding (15) = 1770. So we have 1770px width that is available for tiling.

Split 1770 between two windows with a 15px gap; each window should have a width of: (1770 - 15) * 0.5 = 877.5.
We round down so each window gets a width of 877 (AX API does not allow usage of decimals).

left window
15 + 877 = 892

+15 gap

right window
907 + 877 = 1784

1800 - 1784 = 16 pixel right_padding

the right window can be positioned at 908 instead, but then you get 16px gap between windows instead.

@aspauldingcode
Copy link
Author

Hm.. so maybe I should be setting all the gaps to even numbers(?) that makes a lot of sense

@aspauldingcode
Copy link
Author

I think visually it would look better if we sacrificed the in-between spacing vs outside. This will look more polished as it is very hard to tell or eyeball the center of the screen versus the edges...

This will being polish to yabai

@koekeishiya koekeishiya added the addressed on master; not released Fixed upstream, but not yet released label Jan 8, 2025
@koekeishiya
Copy link
Owner

Adjusted on the latest master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addressed on master; not released Fixed upstream, but not yet released
Projects
None yet
Development

No branches or pull requests

2 participants