koekeishiya / yabai

A tiling window manager for macOS based on binary space partitioning
MIT License
23.15k stars 641 forks source link

Flickering with border_blur #1665

Closed Gigibeau closed 11 months ago

Gigibeau commented 1 year ago

Hey there! First of all thanks for this awesome window manager, love it (:.

I have 3 small problems, two concerning flickering and one about window alignment.

  1. When using transparency + blur, there is a flickering every time I change focus to or away from the window with blur:

CleanShot 2023-03-16 at 21 35 29

  1. This is a weird one. So I'm using this app called Dynamic Wallpaper Engine. Every time I plug in my external monitor the transparency of my windows is gone (only the ones that have blur). When I move my mouse on the same display the transparency comes back for a second though. The workaround right now is to restart the Dynamic Wallpaper app, then everything runs perfectly fine. Funnily enough the problem is gone when I'm recording my desktop so I had to record with my phone:

https://user-images.githubusercontent.com/65814943/225752379-f634e313-9569-4c5f-865e-778d9487206f.mov

  1. Whenever I use my external monitor the windows are not aligned properly on the bottom part (padding is ignored and it is even cut off a bit). Moving them with the mouse action resolves the issue. But it comes back when I restart yabai:

CleanShot 2023-03-16 at 22 14 52

I know these are minor things, but I still would love to resolve them.

#!/usr/bin/env bash

set -x

# ===== Loading Scripting Additions ============

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

# ===== Tiling setting =========================

yabai -m config layout                      bsp

# yabai -m config debug_output                            on

yabai -m config top_padding                 10
yabai -m config bottom_padding              10
yabai -m config left_padding                10
yabai -m config right_padding               10
yabai -m config window_gap                  10

yabai -m config mouse_follows_focus         off
yabai -m config focus_follows_mouse         off

yabai -m config window_topmost              off
yabai -m config window_shadow               float

yabai -m config window_border               off
yabai -m config window_border_width         1
yabai -m config active_window_border_color  "0xFF0000"
yabai -m config normal_window_border_color  "0xFF0000"
yabai -m config insert_feedback_color       "0xFF0000"

yabai -m config window_opacity                on
yabai -m config active_window_opacity       1.0
yabai -m config normal_window_opacity       0.90
yabai -m config split_ratio                 0.50
yabai -m config window_placement            second_child

yabai -m config auto_balance                off

yabai -m config mouse_modifier              ctrl
yabai -m config mouse_action1               move
yabai -m config mouse_action2               resize

yabai -m config window_border_blur           on

# yabai -m config window_animation_duration    0.25
# yabai -m config window_opacity_duration      0.15

# ===== Desktop labels =========================

yabai -m space 1 --label misc
yabai -m space 2 --label webbrowser
yabai -m space 3 --label social
yabai -m space 4 --label organizers
yabai -m space 5 --label code

# ===== Rules ==================================

yabai -m rule --add label="Safari" app="^Safari$" title="^(General|(Tab|Password|Website|Extension)s|AutoFill|Se(arch|curity)|Privacy|Advance)$" manage=off 
yabai -m rule --add label="macfeh" app="^macfeh$" manage=off
yabai -m rule --add label="System Preferences" app="^System Preferences$" title=".*" manage=off
yabai -m rule --add label="Color Picker" app="^Color Picker$" title=".*" manage=off
yabai -m rule --add label="Be Focused Pro" app="^Be Focused Pro$" title=".*" manage=off
yabai -m rule --add label="Tunnelblick" app="^Tunnelblick$" title=".*" manage=off
yabai -m rule --add label="App Store" app="^App Store$" manage=off
yabai -m rule --add label="Activity Monitor" app="^Activity Monitor$" manage=on
yabai -m rule --add label="KeePassXC" app="^KeePassXC$" manage=off
yabai -m rule --add label="Calculator" app="^Calculator$" manage=off
yabai -m rule --add label="Dictionary" app="^Dictionary$" manage=off
yabai -m rule --add label="Raycast" app="^Raycast$" manage=off
yabai -m rule --add label="mpv" app="^mpv$" manage=off
yabai -m rule --add label="Software Update" title="Software Update" manage=off
yabai -m rule --add label="About This Mac" app="System Information" title="About This Mac" manage=off
yabai -m rule --add label="Spotify" app="^Spotify$" opacity=0.8 space=social
yabai -m rule --add label="Firefox" app="^Firefox$" opacity=1.0 
yabai -m rule --add label="Chrome" app="^Chrome$" opacity=1.0 
yabai -m rule --add label="QuickTime Player" app="^QuickTime Player$" manage=off opacity=1.0
yabai -m rule --add label="Things" app="^Things$" opacity=0.8 space=organizers
yabai -m rule --add label="Mail" app="^Mail$" opacity=0.8 space=organizers 
yabai -m rule --add label="Calendar" app="^Calendar$" opacity=0.8 space=organizers 
yabai -m rule --add label="Ferdium" app="^Ferdium$" opacity=0.8 space=social
yabai -m rule --add label="Preview" app="^Preview$" opacity=1.0 manage=off
yabai -m rule --add label="Be Focused Pro" app="^Be Focused Pro$" manage=off
yabai -m rule --add label="kitty" app="^kitty$" opacity=1.0 border=on display=2
yabai -m rule --add label="iTerm2" app="^iTerm2$" opacity=1.0

# ===== Signals ================================

set +x
printf "yabai: configuration loaded...\\n"
xckomorebi commented 1 year ago

I encountered similar problem (number 2). I experimented a little bit and here are my findings 1) It seems not "the blur effect is gone". Dynamic Wallpaper Engine automatically sets a static snapshot as the system wallpaper, if you use another dynamic wallpaper app you will find actually all videos behind the blur layer fail to render (same case for something like youtube video). 2) Sketchybar also has that problem @FelixKratz 3) Any video with opacity lower than 1 is not affected, so I added the following line in my configuration:

yabai -m rule --add app="^Dynamic Wallpaper$" opacity=0.99

(works for me, but I believe there are better solutions

HATTER-LONG commented 1 year ago

There is the same number one issue, the blurring effect is good, but the flickering of the switch is frustrating😭

Shortening the blur effect interval can alleviate, but I have no idea how to avoid this.

window_animation_duration 0.22 \
window_opacity_duration 0.22 \
koekeishiya commented 11 months ago

Borders have been removed in the latest release (v6.0.0) (#1889) because of multiple issues present in both Ventura and Sonoma.