asmvik / asmvik/yabai

Arc Browser window becomes unmanaged

Open
#2,464 4 comments 2 reactions 0 assignees View on GitHub
Dominant language
C
Stars
29.6k
Forks
750
PR merge metrics
No merged PRs in 30d

Description

Seemingly randomly, Arc Browser window becomes unmanaged — it floats on topmost layer. Newly opened Arc windows are managed and end up below the original window. Reloading Yabai config **doesn't** fix it. Restarting Yabai service fixes it.

Arc 1.67.0 (55418)-RC
MacOs 15.1

**How it looks:**

Screenshot 2024-10-31 at 9 12 25 AM

**Yabai query for this space:**

```
yabai -m query --windows --space 1
[{
"id":11154,
"pid":5033,
"app":"Arc",
"title":"",
"scratchpad":"",
"frame":{
"x":203.0000,
"y":109.0000,
"w":1470.0000,
"h":924.0000
},
"role":"",
"subrole":"",
"root-window":true,
"display":1,
"space":1,
"level":0,
"sub-level":0,
"layer":"normal",
"sub-layer":"normal",
"opacity":1.0000,
"split-type":"none",
"split-child":"none",
"stack-index":0,
"can-move":false,
"can-resize":false,
"has-focus":false,
"has-shadow":true,
"has-parent-zoom":false,
"has-fullscreen-zoom":false,
"has-ax-reference":false,
"is-native-fullscreen":false,
"is-visible":false,
"is-minimized":false,
"is-hidden":false,
"is-floating":false,
"is-sticky":false,
"is-grabbed":false
},{
"id":11356,
"pid":38980,
"app":"Finder",
"title":"pe8er",
"scratchpad":"",
"frame":{
"x":0.0000,
"y":32.0000,
"w":731.0000,
"h":924.0000
},
"role":"AXWindow",
"subrole":"AXStandardWindow",
"root-window":true,
"display":1,
"space":1,
"level":0,
"sub-level":-20,
"layer":"normal",
"sub-layer":"below",
"opacity":1.0000,
"split-type":"vertical",
"split-child":"first_child",
"stack-index":0,
"can-move":true,
"can-resize":true,
"has-focus":false,
"has-shadow":true,
"has-parent-zoom":false,
"has-fullscreen-zoom":false,
"has-ax-reference":true,
"is-native-fullscreen":false,
"is-visible":false,
"is-minimized":false,
"is-hidden":false,
"is-floating":false,
"is-sticky":false,
"is-grabbed":false
},{
"id":11342,
"pid":5033,
"app":"Arc",
"title":"Fun",
"scratchpad":"",
"frame":{
"x":739.0000,
"y":32.0000,
"w":926.0000,
"h":924.0000
},
"role":"AXWindow",
"subrole":"AXStandardWindow",
"root-window":true,
"display":1,
"space":1,
"level":0,
"sub-level":-20,
"layer":"normal",
"sub-layer":"below",
"opacity":1.0000,
"split-type":"vertical",
"split-child":"second_child",
"stack-index":0,
"can-move":true,
"can-resize":true,
"has-focus":false,
"has-shadow":true,
"has-parent-zoom":false,
"has-fullscreen-zoom":false,
"has-ax-reference":true,
"is-native-fullscreen":false,
"is-visible":false,
"is-minimized":false,
"is-hidden":false,
"is-floating":false,
"is-sticky":false,
"is-grabbed":false
}]
```

**yabairc**

```bash
#!/bin/bash

# Unload the macOS WindowManager process
launchctl unload -F /System/Library/LaunchAgents/com.apple.WindowManager.plist >/dev/null 2>&1 &

# Load scripting additions
sudo yabai --load-sa

#Setup basic signals
yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa" label="loadSa"
yabai -m signal --add event=window_created action="sketchybar --trigger space_windows_change" label="sketchybarNewWindowCreated"
yabai -m signal --add event=window_destroyed action="sketchybar --trigger space_windows_change" label="sketchybarWindowDestroyed"

# Float small, non-resizable windows
yabai -m signal --add event=window_created action='yabai -m query --windows --window $YABAI_WINDOW_ID | jq -er ".\"can-resize\" or .\"is-floating\"" || yabai -m window $YABAI_WINDOW_ID --toggle float' label="floatSmallWindows"

yabai_config=(
window_placement second_child
focus_follows_mouse autoraise
mouse_modifier fn
menubar_opacity 0.0
window_animation_duration 0.0
layout bsp
auto_balance off
top_padding 0
bottom_padding 0
left_padding 0
right_padding 0
window_gap 8
)

yabai -m config ${yabai_config[*]}

# Setup spaces
function setup_space {
local idx="$1"
local name="$2"
local space=
echo "setup space $idx : $name"

space=$(yabai -m query --spaces --space "$idx")
if [ -z "$space" ]; then
yabai -m space --create
fi

yabai -m space "$idx" --label "$name"
echo yabai -m space "$idx" --label "$name"
}

setup_space 1 Web
setup_space 2 Mail
setup_space 3 Todo
setup_space 4 Code
setup_space 5 Media
setup_space 6 Design
setup_space 7 Presentation

# Assign apps to specific spaces
yabai -m rule --add app="^(Arc|Discord)$" space=1
yabai -m rule --add app="^(Mail)$" space=2
yabai -m rule --add app="^(Things|Notes|Reminders)$" space=3
yabai -m rule --add app="^(VSCodium|iTerm)$" space=4
yabai -m rule --add app="^(Music|Popcorn-Time|Spotify)$" space=5
yabai -m rule --add app="^(Figma|Adobe)$" space=6
yabai -m rule --add app="^(Pages|Keynote|Microsoft)$" space=7

# Override default layouts
yabai -m config --space 5 layout stack

# Manage apps and windows
yabai -m rule --add label="Mail messages" app="Mail" title="(New|Message|Re)" manage=off layer=above
yabai -m rule --add app="^(Steam Helper|Raycast|Calculator|Software\ Update|Dictionary|VLC|System\ Settings|zoom.us|Photo\ Booth|Archive\ Utility|Clock|Plexamp|Alfred\ Preferences|ImageOptim|The\ Unarchiver|Installer|Hosting\ AU)$" manage=off
yabai -m rule --add label="Small windows" title="(Co(py|nnect)|Move|Info|Pref)" manage=off
yabai -m rule --add app="^(Trash|Copy|Bin|Move|About This Mac|Info|Preferences)$" manage=off layer=above
yabai -m rule --add label="GLMv4" app="^GLMv4$" title="(Preparations\ for\ Measurements)" manage=off
yabai -m rule --add label="Cyberduck" app="^Cyberduck$" title="(Transfers)" manage=off
yabai -m rule --add label="About This Mac" app="System Information" title="About\ This\ Mac" manage=off
yabai -m rule --add label="Activity Windows" title="^Activity$" manage=off
yabai -m rule --add app="^Adobe (After Effects|Audition|Media Encoder|Lightroom)$" role="AXLayoutArea" subrole="AXFloatingWindow" manage=on
yabai -m rule --add app="^IINA$" manage=off

# Define scratchpads
# https://github.com/koekeishiya/yabai/issues/2203
# :::::
yabai -m rule --add app="^Messages$" scratchpad=Messages grid=5:5:1:1:3:3
yabai -m rule --add app="^Transmission$" scratchpad=Transmission grid=5:7:2:1:3:1

# Apply rules to existing windows
yabai -m rule --apply

echo "Yabai configuration loaded…"
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the unmanaged Arc window and capture `yabai -m query --windows --space 1` before and after the failure; compare it with the restart behavior. Review `yabairc`, especially the `window_created` signal, `floatSmallWindows` rule, Arc space rule, and final `yabai -m rule --apply`. Done means Arc windows remain managed and correctly layered without restarting yabai.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, macos
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.