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

Yabai occasionally fails to detect windows #1722

Closed
mikemykhaylov opened this issue Apr 29, 2023 · 5 comments
Closed

Yabai occasionally fails to detect windows #1722

mikemykhaylov opened this issue Apr 29, 2023 · 5 comments

Comments

@mikemykhaylov
Copy link

mikemykhaylov commented Apr 29, 2023

In the last 2 to 3 months, I've started noticing that occasionally Yabai fails to recognize, and therefore manage, different apps. Closing and reopening the app always fixes the issue, but it is annoying. Specifically, I've noticed it with System Settings, Alacritty and IINA. I've been able to recently catch it when a terminal (Alacritty) was not recognized, so I could query Yabai without altering the window arrangement.

Setup

macOS 13.1.1, yabai 5.0.3, two native full-screen spaces, one normal with sketchybar at the top.
Screenshot 2023-04-29 at 16 47 37

Screenshot 2023-04-29 at 16 43 24

Alacritty is clearly not managed by Yabai, as I can't float or unfloat the window. The result of running yabai -m query --windows is below:

[{
	"id":362,
	"pid":10567,
	"app":"Code",
	"title":"battery.sh — Untitled (Workspace)",
	"frame":{
		"x":0.0000,
		"y":0.0000,
		"w":1440.0000,
		"h":900.0000
	},
	"role":"AXWindow",
	"subrole":"AXStandardWindow",
	"display":1,
	"space":2,
	"level":0,
	"opacity":1.0000,
	"split-type":"none",
	"split-child":"none",
	"stack-index":0,
	"can-move":false,
	"can-resize":true,
	"has-focus":true,
	"has-shadow":true,
	"has-border":true,
	"has-parent-zoom":false,
	"has-fullscreen-zoom":false,
	"is-native-fullscreen":true,
	"is-visible":false,
	"is-minimized":false,
	"is-hidden":false,
	"is-floating":true,
	"is-sticky":false,
	"is-topmost":false,
	"is-grabbed":false
},{
	"id":116,
	"pid":902,
	"app":"Arc",
	"title":"Applescript for specific System Preferences pane - Ask Different",
	"frame":{
		"x":0.0000,
		"y":0.0000,
		"w":1440.0000,
		"h":900.0000
	},
	"role":"AXWindow",
	"subrole":"AXStandardWindow",
	"display":1,
	"space":3,
	"level":0,
	"opacity":1.0000,
	"split-type":"none",
	"split-child":"none",
	"stack-index":0,
	"can-move":false,
	"can-resize":true,
	"has-focus":false,
	"has-shadow":true,
	"has-border":true,
	"has-parent-zoom":false,
	"has-fullscreen-zoom":false,
	"is-native-fullscreen":true,
	"is-visible":false,
	"is-minimized":false,
	"is-hidden":false,
	"is-floating":false,
	"is-sticky":false,
	"is-topmost":false,
	"is-grabbed":false
}]

It is evident that Yabai doesn't see the window. When querying the space in which the terminal is situated, I get an empty array.

> yabai -m query --windows --space 1
[]
> yabai -m query --windows --window
could not retrieve window details.

Here's my config file, nothing that looks suspicious to me

#!/usr/bin/env sh

sudo yabai --load-sa
yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa"

CONFIG=(
# global settings
mouse_follows_focus          off
focus_follows_mouse          off
window_origin_display        default
window_placement             second_child
window_topmost               off
window_shadow                off
window_opacity               off
window_opacity_duration      0.0
window_animation_duration    0.0
window_animation_framerate   60
active_window_opacity        1
normal_window_opacity        1.00
window_border                on
window_border_hidpi          on
window_border_blur           on
window_border_width          1
window_border_radius         10
active_window_border_color   0xFF88C0D0 #88C0D0
normal_window_border_color   0xFF434C5E #434C5E
insert_feedback_color        0xFFD75F5F #D75F5F

split_ratio                  0.50
auto_balance                 off
mouse_modifier               fn
mouse_action1                move
mouse_action2                resize

# general space settings
layout                       bsp
top_padding                  12
bottom_padding               12
left_padding                 12
right_padding                12
window_gap                   6

external_bar                 all:52:0
)

# ignore some apps
yabai -m rule --add app="^(JetBrains Toolbox|TunnelBear|CleanMyMac X)$" manage=off border=off

yabai -m config "${CONFIG[@]}"

echo "yabai configuration loaded.."
@guruor
Copy link

guruor commented May 22, 2023

@mikemykhaylov Faced the same issue with Alacritty before. While other applications were working fine. I had to switch to other terminal emulator like kitty or wezterm, that fixed my workflow, but still unaware of the actual cause.

@hamidzr
Copy link

hamidzr commented Jun 17, 2023

I see this in Alacritty as well and mainly only when I'm spawning it as the first window in an empty space.

@CaptainDaVinci
Copy link

CaptainDaVinci commented Jul 25, 2023

Facing the same issue on mac apple silicon.

yabai-v5.0.6

yabai --verbose lists this error when I try to open alacritty

yabai configuration loaded..
EVENT_HANDLER_APPLICATION_LAUNCHED: alacritty (3459) is not observable, subscribing to activationPolicy changes
-[workspace_context observeValueForKeyPath:ofObject:change:context:]: activation policy changed for alacritty (3459)
EVENT_HANDLER_APPLICATION_LAUNCHED: alacritty (3459) is not finished launching, subscribing to finishedLaunching changes
EVENT_HANDLER_APPLICATION_TERMINATED: alacritty (3459) (not observed)

Used to work fine on intel mac yabai-v4.0.1

@CaptainDaVinci
Copy link

This solved this issue for me: #1250 (comment)

@koekeishiya
Copy link
Owner

Maybe duplicate of #1833

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

5 participants