Skip to content

Workaround for dimmed HDR content in full screen on macOS 13, #3844 #4031

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

Merged
merged 2 commits into from
Nov 3, 2022

Conversation

low-batt
Copy link
Contributor

@low-batt low-batt commented Nov 3, 2022

This workaround also addresses another macOS Ventura regression where an external monitor goes black, #4015.

This same dimming problem was reported in issues #3880, #4013 and #4014.

The workaround changes the windowDidLoad method of MainWindowController such that when running under macOS Ventura it will add a tiny subview with such a low alpha level it is invisible to the human eye.

Issue #4015 has been reproduced without IINA, so we are certain this is a regression in macOS 13. At this time we do not know the root cause and can not explain why this workaround works.


Description:
Starting with macOS 13, some strange behavior can be seen when viewing videos in full screen in HDR mode. The screen will be dimmed when the player controls disappear. This workaround adds a tiny invisible subview when running under macOS 13 so that there is always more than one "visible" view in the window.

Many thanks to @royj who came up with the original workaround. This PR addresses feedback from reviewers.

This workaround also addresses another macOS Ventura regression where
an external monitor goes black, #4015.

This same dimming problem was reported in issues #3880, #4013 and #4014.

The workaround changes the windowDidLoad method of MainWindowController
such that when running under macOS Ventura it will add a tiny subview
with such a low alpha level it is invisible to the human eye.

Issue #4015 has been reproduced without IINA, so we are certain this is
a regression in macOS 13. At this time we do not know the root cause and
can not explain why this workaround works.
@@ -550,6 +550,19 @@ class MainWindowController: PlayerWindowController {
// gesture recognizer
cv.addGestureRecognizer(magnificationGestureRecognizer)

// Workaround a bug in macOS Ventura where HDR content becomes dimmed when playing in full
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Workaround a bug in macOS Ventura where HDR content becomes dimmed when playing in full
// Work around a bug in macOS Ventura where HDR content becomes dimmed when playing in full

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed typo.

// screen mode once overlaying views are fully hidden (issue #3844). After applying this
// workaround another bug in Ventura where an external monitor goes black could not be
// reproduced (issue #4015). The workaround adds a tiny subview with such a low alpha level it
// is invisible to the human eye.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like a short comment mentioning that this workaround isn't perfect

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added note that it might not be effective in all cases.

@royj
Copy link
Contributor

royj commented Nov 3, 2022

Hopefully this can be merged soon. Glad I could help 🙂

This workaround also addresses another macOS Ventura regression where an
external monitor goes black, #4015.

This same dimming problem was reported in issues #3880, #4013 and #4014.

The workaround changes the windowDidLoad method of MainWindowController
such that when running under macOS Ventura it will add a tiny subview
with such a low alpha level it is invisible to the human eye.

Issue #4015 has been reproduced without IINA, so we are certain this is
a regression in macOS 13. At this time we do not know the root cause and
can not explain why this workaround works. This workaround may not be
effective in all cases.
@lhc70000
Copy link
Member

lhc70000 commented Nov 3, 2022

@uiryuu Please confirm that it works on your machine, then you can merge it.

@uiryuu uiryuu merged commit 9425c54 into develop Nov 3, 2022
@uiryuu uiryuu deleted the fix-3844 branch November 3, 2022 23:14
@ownia
Copy link

ownia commented Nov 4, 2022

Is there a more elegant solution? IMO this workaround sucks.

@low-batt
Copy link
Contributor Author

low-batt commented Nov 4, 2022

@ownia I'm pretty certain all of us agree with your assessment of this fix.

With this workaround in place I was unable to reproduce issue #4015. That problem has been reproduced just using Firefox. This indicates the regression in macOS Ventura is not tied to something special about IINA.

Both the dimming problem and the black screen problem occur when IINA is in full screen mode and not showing the on screen controller. At least we think that behavior is consistent.

We do not know the root cause of the problem in Ventura. We can not explain why the problem does not occur when the change in this PR in place other than we are making it seem like the OSC is always being displayed to avoid one of the conditions we think are required to trigger the macOS 13 regression.

The term for this kind of fix is hackaround.

Any additional information concerning this problem or suggestions for alternative workarounds welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants