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

Rework window levels and opacity #1887

Closed
koekeishiya opened this issue Oct 9, 2023 · 9 comments
Closed

Rework window levels and opacity #1887

koekeishiya opened this issue Oct 9, 2023 · 9 comments
Labels
suggestion Request for new feature or some form of enhancement

Comments

@koekeishiya
Copy link
Owner

koekeishiya commented Oct 9, 2023

Making a window appear on top of other windows does not work very well for basically anything that is not a video player.

There are currently three layers in use; "below", "normal", "above".

The window_topmost command (uses layer "above") should be removed. Instead, all managed (read: tiled) windows will appear at a level lower (layer "below") than the standard window level (layer "normal"), effectively achieving the same goal without all the issues. The user will still be able to change the window layer using the respective command or using rules to utilize any layer if they so wish.

The window fading mechanism is useful as a focus-mode kind of option, but it falls short when using multiple monitors. The opacity mechanism should not extend across spaces.

@koekeishiya koekeishiya added the suggestion Request for new feature or some form of enhancement label Oct 9, 2023
koekeishiya added a commit that referenced this issue Oct 10, 2023
koekeishiya added a commit that referenced this issue Oct 10, 2023
koekeishiya added a commit that referenced this issue Oct 10, 2023
koekeishiya added a commit that referenced this issue Oct 10, 2023
@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 Oct 10, 2023
@edofe99
Copy link

edofe99 commented Oct 19, 2023

Hi, sorry but exactly why did you removed this feature? It was really useful.

Plase can you at least provide an explaination on how to use those "layers"? Suppose I use a shortcut to toggle a window from managed to float. Now I have the float window and a managed window. How can I use a keyboard shortcut to make the float window topmost?

With this release you removed lots of features that made this app so special (borders on top of all), I did not experienced any performance issue or whatsoever, don't really understand why deleting features. So weird.

Anyway, I trust you're making the right choices for the app, I'm a noob and barely able to create a config file for yabai. Please could you give an explaination on how to have topmost? It's really important to me. Thank's.

@mefengl
Copy link

mefengl commented Oct 31, 2023

@ironhak see #1898

@preland
Copy link

preland commented Nov 15, 2023

I'm more or less okay with this change; it should be noted that this change is not reflected in the wiki; nor is it mentioned anywhere other than this PR and the changelog

@mortang2410
Copy link

Same as above. I was super confused as to how everything completely broke. There should be a big sign on the home page or wiki announcing the breakage of everything as well as how to effectively migrate.

@koekeishiya
Copy link
Owner Author

There should be a big sign on the home page or wiki announcing the breakage of everything

Or you could learn what semantic versioning is, and read the changelog before deciding to upgrade.

Changelog

All notable changes to this project will be documented in this file.

This project adheres to Semantic Versioning.

-- https:/koekeishiya/yabai/blob/master/CHANGELOG.md

@alber70g
Copy link

alber70g commented Dec 22, 2023

What is the migration path to keep the old behaviour? It's not listed in the changelog, nor in the referenced PR, nor in the wiki.

EDIT: Found a reference to LAYER here: https:/koekeishiya/yabai/blob/master/doc/yabai.asciidoc#:~:text=LAYER%20%20%20%20%20%20%20%3A%3D%20below%20%7C%20normal%20%7C%20above

I'm using this to center and unmanage my window when I like to do so:

Simple version:

alt - t : yabai -m window --toggle float;\
          yabai -m window --grid 12:12:2:2:8:8

Complicated version when using ultrawide screen:

alt - t : screen_width=$(yabai -m query --displays | jq "map(select(.index == $(yabai -m query --windows | jq 'map(select(."has-focus" == true))[0].display')))[0].frame.w"); \
  screen_height=$(yabai -m query --displays | jq "map(select(.index == $(yabai -m query --windows | jq 'map(select(."has-focus" == true))[0].display')))[0].frame.h"); \
  screen_ratio=$(echo "scale=2; $screen_width / $screen_height" | bc); \
  yabai -m window --toggle float; \
  echo "$screen_ratio"; \
  if [[ $(echo "$screen_ratio > 1.78" | bc) -eq 1 ]] ; then \
    echo '> 16:9';\
    yabai -m window --grid 12:12:3:0:6:12; \
  else  \
    echo '< 16:9';\
    yabai -m window --grid 12:10:2:2:6:8; \
  fi

Edit Solution

Adding --layer below makes everything work as expected.

This one is simplified to one command as well:

- alt - t : yabai -m window --toggle float;\
-          yabai -m window --grid 12:12:2:2:8:8
+ alt - t : yabai -m window --toggle float --grid 12:12:2:2:8:8 --layer below
alt - t : screen_width=$(yabai -m query --displays | jq "map(select(.index == $(yabai -m query --windows | jq 'map(select(."has-focus" == true))[0].display')))[0].frame.w"); \
  screen_height=$(yabai -m query --displays | jq "map(select(.index == $(yabai -m query --windows | jq 'map(select(."has-focus" == true))[0].display')))[0].frame.h"); \
  screen_ratio=$(echo "scale=2; $screen_width / $screen_height" | bc); \
-  yabai -m window --toggle float; \
+  yabai -m window --toggle float --layer below; \
  echo "$screen_ratio"; \
  if [[ $(echo "$screen_ratio > 1.78" | bc) -eq 1 ]] ; then \
    echo '> 16:9';\
    yabai -m window --grid 12:12:3:0:6:12; \
  else  \
    echo '< 16:9';\
    yabai -m window --grid 12:10:2:2:6:8; \
  fi

Same goes for all "presets" in .yabairc

yabai -m rule\
  --add app="(Gnucash|PrinterProxy|Telegram|Inkscape|PIDtoolbox|QuickTime Player|System Preferences|System Settings|Music|Finder|Parallels|LastPass|Jetbrains Toolbox|Sublime Text|Company Portal|Authy|OpenVPN|Citrix Receiver|Steam)"\
  manage=off\
  layer=below
yabai -m rule --add app="^Microsoft Outlook$" title="^Inbox"    manage=on layer=below

@koekeishiya
Copy link
Owner Author

koekeishiya commented Dec 30, 2023

If you want the old behaviour simply add a blanket rule. This only works on the master branch currently, but will work in v6.0.3:

yabai -m rule --add app=".*" layer=normal

ryan4yin added a commit to ryan4yin/nix-config that referenced this issue Jan 28, 2024
@Vanderhoof
Copy link

@koekeishiya the fix above stopped working : {
Even after I changed the layer to sub-layer. What am I missing?

Screen.Recording.2024-04-24.at.08.25.25.mov

@imshenshen
Copy link

@koekeishiya the fix above stopped working : { Even after I changed the layer to sub-layer. What am I missing?

Screen.Recording.2024-04-24.at.08.25.25.mov

only work for new window?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion Request for new feature or some form of enhancement
Projects
None yet
Development

No branches or pull requests

8 participants