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

Windows changing while switching between spaces in stack layout #2467

Open
alvinlal opened this issue Nov 1, 2024 · 0 comments
Open

Windows changing while switching between spaces in stack layout #2467

alvinlal opened this issue Nov 1, 2024 · 0 comments

Comments

@alvinlal
Copy link

alvinlal commented Nov 1, 2024

Hi there 👋 , thanks for this amazing tool, it have really changed the way i work

this issue is something thats been bugging me from time to time

i am using stack layout since i want my windows stacked on top of each other in a space, the problem is , when i switch to another space (i am not using yabai for switching spaces, i am using macs mission control keyboard shortcut) and come back to the original space from where i switched , the next window in the stack is focused in that space.

for example, consider two spaces:-

space 1 :- vscode window 1 , vscode window 2, postman window
space 2: - vscode window 3, vscode window 4, chrome window

consider we are in space 1 now and vscode window 1 is in focus and is in top of the stack, then when i switch to space 2, and come back to space 1, vscode window 2 is focused instead of vscode window 1, and then when i switch to space 2 again , vscode window 4 is focused instead of vscode 3,

i only observed this behaviour with multiple windows of vscode, and is only present when multiple windows of the same application is present in a space, which means if postman window is in focus on space 1 and i go to space 2 and come back to space 1 , postman window will be in focus as expected

any idea why this is happening ?

here is my yabairc

# bsp, stack or float
yabai -m config layout stack

yabai -m space --layout stack

# Set default behavior for new windows
yabai -m config window_placement second_child
yabai -m config window_follows_mouse focus


# spaces
yabai -m space 1 --label app1
yabai -m space 2 --label app2
yabai -m space 3 --label app3
yabai -m space 4 --label slack
yabai -m space 5 --label finder
yabai -m space 6 --label chrome-personal
yabai -m space 7 --label chrome-work

# app ignores
yabai -m rule --add app="^Calculator$" manage=off

# app assigns
yabai -m rule --add app="Code" title=".*app1.*" space=app1
yabai -m rule --add app="Code" title=".*app2.*" space=app2
yabai -m rule --add app="Code" title=".*app3.*" space=app3

my skhdrc :-

# Change focus between external displays (top and bottom)
cmd - i : yabai -m display --focus north && yabai -m window --focus stack.recent
cmd - m : yabai -m display --focus south && yabai -m window --focus stack.recent


# Move window to prev and next space
shift + alt - p : yabai -m window --space prev;
shift + alt - n : yabai -m window --space next;

# Move window to space
shift + alt - 1 : yabai -m window --space 1;
shift + alt - 2 : yabai -m window --space 2;
shift + alt - 3 : yabai -m window --space 3;
shift + alt - 4 : yabai -m window --space 4;
shift + alt - 5 : yabai -m window --space 5;
shift + alt - 6 : yabai -m window --space 6;
shift + alt - 7 : yabai -m window --space 7;

# Start / Stop yabai
ctrl + alt - y : yabai --restart-service

# Start / Stop skhd
ctrl + alt - s : skhd --restart-service

# Focus the next window of the same application in the stack
cmd - j : yabai -m window --focus stack.next || yabai -m window --focus stack.first 

# Focus the previous window of the same application in the stack
cmd - k : yabai -m window --focus stack.prev || yabai -m window --focus stack.last

thanks in advance

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

No branches or pull requests

1 participant