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

Statusbar Y-Offset to avoid clash with -menubar #220

Closed
kawtharrr opened this issue Aug 25, 2019 · 11 comments
Closed

Statusbar Y-Offset to avoid clash with -menubar #220

kawtharrr opened this issue Aug 25, 2019 · 11 comments
Labels
enhancement New feature or request

Comments

@kawtharrr
Copy link

kawtharrr commented Aug 25, 2019

Hi, firstly great app, thanks for your effort on this one :) even smoother than chunkwm

Currently, with the system menubar active, the yabai statusbar is hidden/behind it and unusable

(indeed, when I first activated it, it took me a minute to realise that the yabai statusbar feature isn't broken, but incompatible with the on-by-default macOS menubar)

Is it currently possible to offset the statusbar Y co-ordinate?

Couldn't find anything in the docs - so perhaps this is more a feature request? e.g.statusbar_offset on pushes it down by x px, the standard menubar height?

Rationale
Design-improvement - makes config statusbar on unambiguous, per good design principles. Currently, under default macOS config it's not immediately clear that statusbar config on is successful
General feature-request - adds a significant usability & accessibility improvement, removes compromise between menubar or statusbar

As it's an already-existing config for statusbar, this still avoids clashing with its inherently simple and limited-by-design philosophy while making it usable under default macOS config (visible menubar)

@koekeishiya
Copy link
Owner

Can't be done through config, but you can always edit src/bar.c to change its position.

@koekeishiya koekeishiya added the suggestion Request for new feature or some form of enhancement label Sep 3, 2019
@frangkli
Copy link

frangkli commented Sep 18, 2019

@kawtharrr did you figure out a way to edit src/bar.c to achieve that functionality? I want to do the same thing but I have no clue where to edit.

Also just to bring up an issue with the fixed status bar, while using XQuartz application windows like zathura and sxiv, the title bar of the window gets hidden behind the yabai status bar so it becomes impossible to move the windows around. I know from chunkwm that window manages on mac can't handle XQuartz because of API issues but is there a way to solve this problem in another way?

@koekeishiya
Copy link
Owner

The following edits should be enough to have the statusbar be drawn at the bottom of the screen, instead of at the top.

change https://github.com/koekeishiya/yabai/blob/master/src/bar.c#L273 to
SLSSetWindowShape(g_connection, bar->id, 0.0f, bounds.size.height - 26.0f, frame_region);

change https://github.com/koekeishiya/yabai/blob/master/src/bar.c#L476 to
SLSNewWindow(g_connection, 2, 0.0f, bounds.size.height - 26.0f, frame_region, &bar->id);

remove this line: https://github.com/koekeishiya/yabai/blob/master/src/display.c#L87

@frangkli
Copy link

@koekeishiya thank you so much! Sorry it might have been a dumb question because I'm not that fluent in C.

@adinapoli
Copy link

Resurrecting this thread out of interest: @koekeishiya , is there any technical showstopper as why this cannot be done via config? I suspect something as simple as a status_bar_position <top|bottom> configwise would cover 99% of the use-cases.

(ps. thank you for your great work on chunkwm before and yabai now 😉 ).

@adinapoli
Copy link

I have tentatively opened a PR: #302

@koekeishiya
Copy link
Owner

is there any technical showstopper as why this cannot be done via config?

Well, yes and no. As I mentioned in #287,

I'm not really interested in having changes to the bar upstream. It is meant to be pretty dumb and simple, which is why the code is written as it is. I don't think adding tons of commands such as these is the proper way to design a bar that people can customize. It should be done from scratch in a modular way.

I don't really want to accept changes that just build upon the current design, because it is inherently not a good way to approach this problem. I am currently working on separate side projects and so making a proper extensible bar to go along with yabai is not a priority of mine.

@adinapoli
Copy link

adinapoli commented Nov 8, 2019 via email

@koekeishiya
Copy link
Owner

The PR I referenced isn't for this exact change, but it is a different kind of change to the statusbar. They both follow the same pattern of simply expanding the set of available commands, which is not the way I want this to develop.

@kawtharrr
Copy link
Author

Any chance of convincing you that adding an offset option might actually align with your overall objections i.e. that as more features get added it will eventually become more modular - maybe even a plugin - and so break away from the current limited paradigm (as long as additional PRs are submitted and designed with that endgoal in mind)? 😁

@kawtharrr kawtharrr changed the title Setting Y co-ordinate for status bar? Statusbar Y-Offset to avoid clash with -menubar Nov 27, 2019
@koekeishiya
Copy link
Owner

Any chance of convincing you that adding an offset option might actually align with your overall objections i.e. that as more features get added it will eventually become more modular

Not really, as the current design is just flawed in general for that purpose. However, I do agree that the bar should automatically offset if the Apple menubar is visible. This is trivial to fix and should just always happen. For people that run with the Apple menubar hidden there will be no difference.

@koekeishiya koekeishiya added enhancement New feature or request and removed suggestion Request for new feature or some form of enhancement labels Nov 29, 2019
koekeishiya added a commit that referenced this issue Nov 29, 2019
@koekeishiya koekeishiya added addressed on master; not released Fixed upstream, but not yet released and removed addressed on master; not released Fixed upstream, but not yet released labels Nov 29, 2019
brorbw pushed a commit to brorbw/yabai that referenced this issue Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants