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

Arc Browser window becomes unmanaged #2464

Open
Pe8er opened this issue Oct 31, 2024 · 2 comments
Open

Arc Browser window becomes unmanaged #2464

Pe8er opened this issue Oct 31, 2024 · 2 comments

Comments

@Pe8er
Copy link

Pe8er commented Oct 31, 2024

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

#!/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
# <rows>:<cols>:<start-x>:<start-y>:<width>:<height>
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…"
@DriedYellowPeach
Copy link

I have the same issue, but no matter what I do(reload or restart everything), the arc browser is not managed, but other windows is fine

@ognistik
Copy link

ognistik commented Nov 6, 2024

Honestly Arc has a long list of issues with Yabai, this one is just one of them. I think this has to do a lot with Arc itself, with the handling of windows they have chosen, or window titles and such. I don't know all the specifics. I was hoping that as Arc would improve, bugs like this would be taken care of.. but after they've announced that they are halting development of Arc to focus on another browser, I doubt the little annoyances will ever be fixed.

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

3 participants