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

Usability of window borders - potential removal #487

Closed
koekeishiya opened this issue Apr 23, 2020 · 49 comments
Closed

Usability of window borders - potential removal #487

koekeishiya opened this issue Apr 23, 2020 · 49 comments
Labels
discussion Discussion

Comments

@koekeishiya
Copy link
Owner

koekeishiya commented Apr 23, 2020

Edit2:

Improved border system has been implemented on master. See #565

Edit:

Borders have been moved into a standalone application: https://github.com/koekeishiya/limelight


Original post:

So after using yabai for a while now, I find that window borders are pretty much just annoying.
In an ideal world they would be a great addition, but it is just not possible to do that without injecting code into every single application.

My issue is mainly the fact that we have to use an external window, and cannot actually just override the border attribute of the actual NSWindow.

By using an external window we hit a couple of unfixable issues that really degrade the experience of this feature. These include, but are not limited to:

  1. The border is always slightly delayed when moving or resizing a window.
  2. The border is treated as a separate entity in the window sorting/layering of the operating system, making it pretty much impossible to avoid issues where the border is incorrectly drawn below/above some other window.
  3. The fact that we always have to try and keep the border in sync with the active space of the window it belongs to at any time, and the lack of APIs to receive events for such actions, there is also a noticeable performance impact when the number of windows grow large enough (lower threshold for lower-end machines).

The main thing I care about that would need a replacement in case borders are removed, is the visual feedback for the region selected through the --insert command.

Thoughts?

@koekeishiya koekeishiya added the discussion Discussion label Apr 23, 2020
@dominiklohmann
Copy link
Collaborator

The window borders as is are of much lower quality than the rest of yabai. I'm all for this change, especially with the maintainability and performance aspects in mind.

@koekeishiya
Copy link
Owner Author

I'm very much leaning towards just pruning borders. I mainly created this issue just to get some thoughts. I'll leave it up for a while so people can post their opinion, but yeah, I think it's for the better to let it go.

@RowanFeely
Copy link

Im running macos mojave (10.14.6) and i use the borders feature religiously simply to remove the absolutely horrible looking white line border edge that the OS renders on all windows.

image

as such im well versed in the shortcomings of the borders feature and understand why its going on the firing line, but does anyone have any alternative solutions to getting rid of the window edge? I'm hoping theres some method i haven't come across yet. Anyway, despite it being an always used feature by me, i still understand why it needs to be dropped.

@rockyzhang24
Copy link

Yeah, the border performance annoys me a lot. When I turn it off, I find I cannot live without it, but if I leave it on for a while, its bad performance pushes me to turn it off.

1). What I was thinking at the beginning is that using the border to differentiate the active window and non-active windows. Especially when I opened many terminal windows on a single workspace and all of them looked the same (black background and no decorators like title bar), without using the border, I had to use the cursor shape to distinguish which one was active and sometimes I had to spend a while to look for the solid cursor among many terminal windows.

2). What's more, I used the border to show the region selection (--insert) as you mentioned.

Due to its bad performance and issues as you listed, I turn it off half a month ago. Based on my user experience without using the border, I find I get used to it.
For 1). I find that the situation where I cannot find the active window only happens when I leave my desk and come back after a while because I cannot remember where my cursor is. However, if I sit in front of my desk and continue working, each cursor movement (i.e., focus changing) is initiative and we know where the cursor is subconsciously even when I switch between workspaces frequently.
For 2). The same. Region selection is always followed by a window creation. So we don't need the visual mark. We just need to select a position and then create a new window. That's it.

My opinion is that no border is better than having a terrible one. However, if we could come up with a way to show the visual feedback, that would be perfect.

Thank you for your hard-working!

@1g0rb0hm
Copy link

1g0rb0hm commented Apr 25, 2020

I am using the window border feature as a visual cue to indicate I am operating in a different skhd mode. It is a bit like the visual cues in nvim and other modal editors and is important to not get lost.

I also realise that there are some glitches with borders and understand why you are considering to remove them. If that happens, do you have a suggestion how to achieve a good visual feedback when changing modes in skhd?

Here is what things look like in action starting with the definition of modes in .skhdrc:

# add an on_enter command to the default mode
:: default   : yabai -m config window_border_width         3;\
               yabai -m config active_window_border_color  0xFFF0DFA7;\
               yabai -m config active_window_opacity       1.0;\
               yabai -m config normal_window_opacity       0.9

:: window  @ : yabai -m config window_border_width         3 ;\
               yabai -m config active_window_border_color  0xff6795FF ;\
               yabai -m config active_window_opacity       0.8 ;\
               yabai -m config normal_window_opacity       0.6

# from 'default' mode, activate mode 'window' (`0x39` -> CAPS LOCK)
cmd - x       ; window
# from 'window' mode, activate mode 'default'
window < cmd - x    ; default
window < escape     ; default
window < i          ; default

And here a little screencast showing what happens when I switch modes (NOTE how window opacity and border colours change and it is the change of border colours that is responsible for the key visual feedback during a mode change in skhd):

Screencast 2020-4-25

NOTE that I also changed the colour of the bar for the case when there were no windows on a screen and I changed modes. Unfortunately the bar is gone now in 034ee3a and I haven't found a good way to achieve the same with the default macOS menu bar.

koekeishiya added a commit that referenced this issue Apr 25, 2020
@koekeishiya koekeishiya added the addressed on master; not released Fixed upstream, but not yet released label Apr 25, 2020
@koekeishiya
Copy link
Owner Author

koekeishiya commented Apr 25, 2020

I think I've pretty much made up my mind and reached the conclusion that window borders will be removed. The required changes have already been added to the master branch.

To answer some of your questions.. I realize that it is hard to replace the visual customizations that borders have provided, and I don't actually have any good alternative approaches to achieve said effects.

@RowanFeely

Im running macos mojave (10.14.6) and i use the borders feature religiously simply to remove the absolutely horrible looking white line border edge that the OS renders on all windows.

I don't actually think I have seen this issue and I don't really have any good solution that you could switch to.

@yanzhang0219

However, if we could come up with a way to show the visual feedback, that would be perfect.

The visual feedback for the insert command remain mostly unchanged from a users perspective.
It is a bit less customizable than before, but I think this is a fine compromise.

@1g0rb0hm

I am using the window border feature as a visual cue to indicate I am operating in a different skhd mode. It is a bit like the visual cues in nvim and other modal editors and is important to not get lost.

This one is hard to replace, and the only solution I can think of (although not really visual) would be to use a bitbar script or adding an entry in your bar (if you use a custom one) that will read the current mode from a text-file or something. Then write to that text file in your skhd binds that change mode. This is far from as effective as your current solution though.

NOTE that I also changed the colour of the bar for the case when there were no windows on a screen and I changed modes. Unfortunately the bar is gone now in 034ee3a and I haven't found a good way to achieve the same with the default macOS menu bar.

The yabai bar was extracted into a standalone application if you wish to continue using it, see #463; that should allow you to keep that part of your config.

@distek
Copy link

distek commented Apr 29, 2020

I know it's a bit late since you've made up your mind, but could we have just a focused window border?

Main benefits being:
Visual cue as to which window is active
Insert indicator still usable

Though it's not much, these can be an integral part of someone's usage.

@koekeishiya koekeishiya removed the addressed on master; not released Fixed upstream, but not yet released label May 1, 2020
@koekeishiya
Copy link
Owner Author

There are other software out there that will provide a border for the focused window.
The visual feedback for the insert command is still present.

@cmacrae
Copy link

cmacrae commented May 1, 2020

Hope people don't mind me commenting on this so soon after it was closed, but I'm hoping it may serve as a good place for a few of us to discuss alternatives to window borders.

I'm personally coming up short - how do others intend to indicate the currently selected window?

@koekeishiya
Copy link
Owner Author

I'm simply using window opacity (works fine if you set duration to 0.0) and cursor placement to indicate the focused window. You could use Honer.app or make something similar if you want a border for the focused window. I suppose it would also be fairly trivial to make a small application that would temporarily highlight the focused window for a couple of seconds, then terminate, that you could activate with a bind from skhd.

@koekeishiya
Copy link
Owner Author

I put together a simple sample program that will give you a focused window border. This is not exstensively tested and probably lacks in some ways. It is not customizable without editing the source and is purely meant to give people a starting point.

I don't mind if people want to submit pull requests, and maybe I will make changes if people report bugs or whatever, but this is a no strings attached thing.

Repo: https://github.com/koekeishiya/limelight

@cmacrae
Copy link

cmacrae commented May 2, 2020

Thanks so much for putting together this example @koekeishiya 🙏
Really appreciate it! I'm going to have a play around with it. Nothing like a global lockdown to help encourage learning new languages ✨

@cmacrae
Copy link

cmacrae commented May 2, 2020

Extra points for the name & default colour 🥝

@koekeishiya
Copy link
Owner Author

Updated the sample with mission-control detection as that is non-trivial for those unfamiliar with the private APIs.

@BlueDrink9
Copy link

I personally loved the window borders, and was happy to put up with the issues. Would you consider making it an optional legacy module? I used it for skhd mode change, for focused window, for general ricing pleasure, and for insert feedback (no longer needed).

If it really is a hassle to work around the other parts of yabai, I totally accept your choice to remove it to save yourself hassle. I can find alternative workarounds. But just wanted to put my thoughts on borders

@minjaegi
Copy link

minjaegi commented May 4, 2020

I think it's a good idea to display the border only for the active window like chunkwm, rather than dropping the border option. I think that displaying the border line to the inactive window is a factor of performance degradation. The important thing is the border of the active window.

@ghost
Copy link

ghost commented May 6, 2020

Hi, sorry for asking, but how can I install Yabai 2.4.3 with Brew? I want to keep the borders in my windows for now, the performance is not that good but works well in my machine and I really like the aesthetics.

@lcjnil
Copy link

lcjnil commented May 6, 2020

@johnkirstenlai try with
brew install https://raw.githubusercontent.com/koekeishiya/homebrew-formulae/026eefaade6cc3e73fc98beb6122fced164d5e10/yabai.rb

@dominiklohmann
Copy link
Collaborator

dominiklohmann commented May 6, 2020

This can also be used, although I don't recommend doing so.

git -C $(brew --repository koekeishiya/formulae) 026eefaade6cc3e73fc98beb6122fced164d5e10 -- yabai.rb
brew reinstall yabai
git -C $(brew --repository koekeishiya/formulae) master -- yabai.rb
brew pin yabai

@cmacrae
Copy link

cmacrae commented May 6, 2020

With the new availability of the Nix package (#510), this is also achievable in a declarative manner using an overlay with overrideAttrs:

self: super: {
  yabai = super.yabai.overrideAttrs (o: {
    version = "2.4.3";
    src = super.fetchFromGitHub {
      owner = "koekeishiya";
      repo = "yabai";
      rev = "v2.4.3";
      sha256 = "1a6pqms5kwdsvr9vcshfa000xf2f5a2qbp5qapx0b3wzclnchjbn";
    };
  });
}

@dominiklohmann
Copy link
Collaborator

@cmacrae To be fair, the user asking for help downgrading a Homebrew package to an older version (which is well documented) is unlikely to use Nix.

Admittedly in an ideal world we'd all use Nix, but that's just not very practical.

@cmacrae
Copy link

cmacrae commented May 6, 2020

Sure, figured I'd share for the sake of others who may take an interest also :)

@ghost
Copy link

ghost commented May 6, 2020

@dominiklohmann I researched before on google how to install a specific version of a package in Brew, I didn't find a quick way to do it so this is why I asked here, I just wanted to go back to how things were so I can get back to work, no need to be rude, i'm just a novice in this macos world, as I said, I apologize for the question.

Yes, I didn't know anything about Nix, thanks @cmacrae for introducing me, now I have a chance to try it here, thanks to all for your help.

@emanuelhouse
Copy link

Despite the slight performance issues and issues with them getting hidden behind windows, I love the borders: both for getting rid of the rounded corners as well as removing the unsightly white border at the top of windows. I use the borders both for focused and unfocused windows. Is it possible to move the border functionality to a separate app?

Have any others found a suitable replacement for drawing borders on all windows?

@narze
Copy link

narze commented May 9, 2020

I just updated to Yabai v3 and thought that it was broken due to missing borders.

I understand and ok with you removing features but it would be great to list all of the options removed so every will update their yabairc file instead of changing them with no effect and get confused like I do.

So I'd suggest listing them in changelog rather than just Status Bar removed & Borders removed

@koekeishiya
Copy link
Owner Author

I figured it was pretty self-explanatory that all border/status bar related commands that where not explicitly mentioned in the changed section was removed. I suppose I can list the removed commands explicitly in the future.

With regards to updating in general, see my comment #500 (comment)

@glepnir
Copy link

glepnir commented May 15, 2020

After removing the border, yabai seems to lose a lot of beauty. I am a loyal border user.
Is it possible to regain the border in version 3.0? Instead of installing the lower version.

@rockyzhang24
Copy link

@pardom
Copy link

pardom commented May 22, 2020

This change was a surprise to me after updating recently, and is a serious UX degradation for my workflow. I'm trying out this as an alternative: https://hazeover.com

@koekeishiya
Copy link
Owner Author

Please see this comment regarding updating: #500 (comment)

Also for people who want a focused window border, see https://github.com/koekeishiya/limelight
It does not allow setting the color during runtime, but that should be fairly trivial for anyone to add.

@glepnir
Copy link

glepnir commented May 22, 2020

I don't think it's a good decision to strip out the border feature, whether i3 or awesome it is built-in and available.

@koekeishiya
Copy link
Owner Author

The reason for the decision is described pretty fairly in my first post. I understand that not everyone is happy with this, but as mentioned there is an actual OS limitation to the quality that can be provided, and it does not fit the bar I have for this project.

@BlueDrink9
Copy link

Would you consider duplicating more of the functionality that yabai/chunkwm had in Limelight? Or are you set on leaving that for others?

@koekeishiya
Copy link
Owner Author

I don't plan on implementing more of the functionality at this point in time.

@daphen
Copy link

daphen commented May 24, 2020

Just writing here to tell you that I'm one of the (few??) people who really value the aesthetics of having borders both for inactive and active windows higher than a slight bump in perf. Reverted to 2.4.3 and I guess I'll never get to upgrade again, unfortunate. 😅

aeonzh added a commit to aeonzh/dotfiles that referenced this issue May 26, 2020
@koekeishiya
Copy link
Owner Author

koekeishiya commented May 26, 2020

Did a basic port of the yabai v2.4.3 border system to limelight branch: https://github.com/koekeishiya/limelight/tree/yabai_borders https://github.com/koekeishiya/limelight

@koekeishiya
Copy link
Owner Author

koekeishiya commented May 26, 2020

Pushed it over the limelight master branch. It has feature parity with the border system from yabai. Syntax of the commands have changed a little, see the sample configuration file in the repo.

Notes for building and automatically running is in the readme. Config location uses same structure as yabai.

@BlueDrink9
Copy link

Thank you so much!

@daphen
Copy link

daphen commented May 26, 2020

Wow, kudos on the quick work. Thanks a lot.

@BlueDrink9
Copy link

Working brilliantly, although there's a large delay between the border appearing the default colour, and the config initialising the desired colours.

I'd like to figure out a way to close it when yabai closes, to use it as a way of knowing whether yabai has started.

@koekeishiya
Copy link
Owner Author

Working brilliantly, although there's a large delay between the border appearing the default colour, and the config initialising the desired colours.

In theory this should not be a longer delay than it was originally in yabai. It uses the same bootstrapping code for tracking applications/windows, and the same config system.

@koekeishiya
Copy link
Owner Author

An improved window border system has been implemented on master. See #565 for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Discussion
Projects
None yet
Development

No branches or pull requests