waydabber / BetterDisplay

Unlock your displays on your Mac! Flexible HiDPI scaling, XDR/HDR extra brightness, virtual screens, DDC control, extra dimming, PIP/streaming, EDID override and lots more!
https://betterdisplay.pro
18.97k stars 336 forks source link

Display may disappear from menu on power off toggle after subsequent configuration attempts #3260

Closed KrzysztofPrzygoda closed 1 month ago

KrzysztofPrzygoda commented 1 month ago

I have two LG 29WP60G-B displays (same model, different manufacture weeks). When I turn off one of them by BD menu power toggle, everything is OK. Then, when I turn off the second one by BD menu power toggle, the previous one disappears (macOS does not detect it). Order doesn't matter - always the first turned off disappears after the second one is turned off next. I have to manually replug both of them then in order to bring disappeared one back (replug disappeared one only has no effect).

It seems that before v3.0.0 there was nothing like this.

waydabber commented 1 month ago

Interesting. Which macOS version are you running? v3.x should not interfere with this as I don't remember making any change that should result in such an issue (I just tried it and seems to work fine, but I have two totally different external displays so the situation might be different).

I could understand what's happening better if I saw logs: start the app in verbose mode from Terminal, do the operations (remembering the exact time) and send over the log, indicating when the critical evens occured.

/Applications/BetterDisplay.app/Contents/MacOS/BetterDisplay -v

Please use the latest internal pre-release for this from here: https://github.com/waydabber/BetterDisplay/releases/tag/pre

KrzysztofPrzygoda commented 1 month ago

As instructed.

  1. BD opened from terminal (BetterDisplay-v3.0.1-b32907-pre).
  2. Display named "Top" turned off.
  3. Display named "Bottom" turned off. This time it disappeared (not Top).
  4. Quit BD. All displays came back.

Everything took less than 1 minute, so it's hard to say exact times. Log attached: bd.log

waydabber commented 1 month ago

All right. Thank you! Will check it out. Until than you can simply go to Tools/Displays.../Connect All Displays to get all displays back. You can add a keyboard shortcut to it as well.

waydabber commented 1 month ago

Does this happen when other displays (like Left, Right) gets disconnected? Or is it only something that happens in relation with the top/bottom display (similar LG displays)? Does it happen when the sequence is different?

KrzysztofPrzygoda commented 1 month ago

Oh, and macOS Sonoma 14.6.

waydabber commented 1 month ago

I assume it works fine with 2.3.9 and 14.6, right, so it's a 3.x specific new issue?

KrzysztofPrzygoda commented 1 month ago

Does this happen when other displays (like Left, Right) gets disconnected? Or is it only something that happens in relation with the top/bottom display (similar LG displays)? Does it happen when the sequence is different?

Top/Bottom only. I have tested Left/Right pair toggle but with no issues so far. While Top, Bottom, Left are connected via USB-C, Right is via HDMI.

KrzysztofPrzygoda commented 1 month ago

I assume it works fine with 2.3.9 and 14.6, right, so it's a 3.x specific new issue?

Hmm... It touches v2.3.9 too. But right now it's only about "Bottom" display. I have played with DCC d6 = 5 or d6 = 4 for OFF but it doesn't make any difference now (I remember it was a difference a year ago).

Anyway, "Bottom" disappears always. Connect All Displays restores proper state.

waydabber commented 1 month ago

It is not entirely clear from the logs what is happening. I think there is an other stored display with the same display ID and that causes confusion when classifying the display as app disconnected without all the identifiers present (which is the case when a display is soft-disconnected, so it's difficult to match exactly to stored settings). I might need to alter some things to cover this possiblity (when a display ID is assigned to a display, I should remove it as stored property from all not connected displays just in case - even if the issue is something else entirely, I think there is a loophole in the current logic).

Can you send me the settings export? https://github.com/waydabber/BetterDisplay/wiki/Export-and-import-app-settings

KrzysztofPrzygoda commented 1 month ago

Voilá: BetterDisplay.plist.zip

waydabber commented 1 month ago

Thank you! :)

waydabber commented 1 month ago

Right. I think I see the problem. I'll try to come up with a fix and let you know when there is a version to test. This issue should not be 3.x specific however, should have happened earlier, the difference might be just down to random chance of having some different stored data. It's a bug nevertheless so thank you for pointing it out!

waydabber commented 1 month ago

The workaround is to go to Tools/Displays.../Connect All Displays to get all displays back.

waydabber commented 1 month ago

I added an updated binary. Can you check out the latest internal pre-release (b32917)? Hopefully the issue is fixed.

https://github.com/waydabber/BetterDisplay/releases/tag/pre

If you can send over the log of the very first run of this version as you also try to reproduce the issue after launch, I'd gain a bit more insight whether the solution works as intended or not. Thanks!

KrzysztofPrzygoda commented 1 month ago

Couldn't find b32917, so I took b32941. Here is the log of the very first run: bd.log I couldn't reproduce the issue toggling every display. Moreover, after that I couldn't reproduce it on v2.3.9 too. So, I take this as a fix, right?

waydabber commented 1 month ago

Yes. It works on v2.3.9 because the new version updated some saved configuration data - but the issue would eventually resurface on v2.3.9. Should be fixed going forward.