Hammerspoon / hammerspoon

Staggeringly powerful macOS desktop automation with Lua

Home Page:http://www.hammerspoon.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: changing brightness via BetterDisplay causes Hammerspoon to get stuck

schlomo opened this issue · comments

Hi, I'm using

  • BetterDisplay Pro Version 2.2.1 Build 26344 to change the brightness on my Macbook displays and to manage external displays.
  • Hammerspoon Version 0.9.100 (6815) with this config.

Since switching to a new M3 Mac on Sonoma 14.3 I noticed that Hammerspoon gets stuck (rotating colour ball) when I use BetterDisplay to change the screen settings or brightness. On my old Mac with essentially the same Hammerspoon configuration I didn't have this problem, ever.

It seems like BetterDisplay makes Hammerspoon see a large amount of screen changes. I'm using hs.screen.allScreens() to watch for screen changes and dump that in my Hammerspoon console and see there hundreds (or thousands) of screen change notifications, even though only the brightness changes:

2024-02-05 09:49:24: allScreens = {
   [1] = "hs.screen: Built-in Retina Display (0x600003c297f8)";
   [2] = "hs.screen: LG Ultra HD (0x600003c2ab38)";
};

2024-02-05 09:49:24: allScreens = {
   [1] = "hs.screen: Built-in Retina Display (0x600003cd55b8)";
   [2] = "hs.screen: LG Ultra HD (0x600003cd55f8)";
};

2024-02-05 09:49:24: allScreens = {
   [1] = "hs.screen: Built-in Retina Display (0x600003cd5678)";
   [2] = "hs.screen: LG Ultra HD (0x600003cd56b8)";
};

2024-02-05 09:49:24: allScreens = {
   [1] = "hs.screen: Built-in Retina Display (0x600003c05a78)";
   [2] = "hs.screen: LG Ultra HD (0x600003c06578)";
};

The hex code behind the screen name is changing.

Any idea what could be the cause here? Any idea how to debug this problem? Any help would be much appreciated!

waydabber/BetterDisplay#2615 cross-posting at BetterDisplay