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

NSRequiresAquaSystemAppearance makes some applications blurry on macOS Retina display #3637

Open
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Labels

Comments

@SDLBugzilla
Copy link
Collaborator

@SDLBugzilla SDLBugzilla commented Feb 11, 2021

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 2.0.12
Reported for operating system, platform: macOS 10.14, x86_64

Comments on the original bug report:

On 2020-04-13 15:55:23 +0000, Donovan Watteau wrote:

Created attachment 4304
Sharp text on the left (ScummVM 2.1.0-beta), blurrier text on the right (ScummVM 2.1.2 exploiting Dark mode with NSRequiresAquaSystemAppearance)

Hi,

Running macOS Mojave 10.14.6 (18G4032) on a Retina 5K, 27-inch, 2017 iMac. Default Retina DPI.

I'm running ScummVM 2.1.2, which was built against SDL2-2.0.10 on Sierra (I still see the same bug when doing my own build with SDL2-2.0.12 on Mojave):
https://www.scummvm.org/frs/scummvm/2.1.2/scummvm-2.1.2-macosx.dmg

Upstream recently added NSRequiresAquaSystemAppearance in its Info.plist file:
scummvm/scummvm@485e8be

Since then, I see that the UI got slightly blurrier. The attached screenshot shows a comparison between this and an earlier release.

You can easily and quickly notice it if you have a Retina display, without requiring any game, by going to Options > Misc > Theme > Classic Theme (Builtin Version). Options > Graphics > Graphics Mode > 3x can also make it even more evident.

The strange thing is that I can revert this blur effect by editing /Applications/ScummVM.app/Contents/Info.plist and removing this:

NSRequiresAquaSystemAppearance

I can't find a lot of information about this particular behaviour, online. What I do remember, though, is that VMWare Fusion enabled Dark Mode in 11.5 as well, and got blurrier content as well:

https://communities.vmware.com/thread/618831

but since it's closed-source, we don't know how they fixed/worked around that.

I'm not sure if the bug is the app I'm using, in SDL2 or in macOS (as maybe hinted in https://twitter.com/icculus/status/1047922666324353029). But I can test patches and such if this helps!

Thanks.

On 2020-04-14 15:11:28 +0000, Sam Lantinga wrote:

Alex, any ideas on this?

On 2020-04-14 15:51:40 +0000, Alex Szpakowski wrote:

I'm guessing VMWare removed the NSRequiresAquaSystemAppearance key and built using the 10.14+ SDK instead. ScummVM should probably do the same, I guess.

On 2020-04-15 06:58:55 +0000, Donovan Watteau wrote:

Upstream likes to provide a good amount of backward compatibility for older macOS releases, so I'm not sure they will chose to use the 10.14+ SDK. Maybe this will be worked around by removing NSRequiresAquaSystemAppearance and missing Dark mode for now, instead.

Anyway, I see that a similar Radar was reported to Apple, back in early Mojave betas:
https://openradar.appspot.com/45895864

And it looks like VLC was hit by a similar problems, but they had another way of working around it, it seems:
https://code.videolan.org/videolan/VLCKit/issues/82#note_30971

I don't know if this can be worked around in SDL2 code as well, or if I should try to open a new Radar (I doubt Apple will care), or if NSRequiresAquaSystemAppearance should be documented as buggy.

On 2020-04-15 11:12:48 +0000, Alex Szpakowski wrote:

(In reply to Donovan Watteau from comment # 3)

Upstream likes to provide a good amount of backward compatibility for older
macOS releases, so I'm not sure they will chose to use the 10.14+ SDK.
Maybe this will be worked around by removing NSRequiresAquaSystemAppearance
and missing Dark mode for now, instead.

Compiling with a newer SDK doesn't prevent an app from running on older operating systems - there's a separate minimum OS target setting from the current SDK being used, so for example I compile my apps with the 10.15 SDK and set their minimum deployment target to 10.7, and they'll run on every OS version between 10.7 and 10.15 (and on newer operating systems when they're released - just not with every new feature of that new OS version).

The layer backed NSOpenGLView stuff is pretty fragile so I'm not sure I'd recommend changing how that works for an issue like this, but maybe someone could find a robust workaround there with some time invested. To me it feels like a much less ideal solution than just using a newer SDK though.

On 2020-04-16 08:40:30 +0000, Donovan Watteau wrote:

(In reply to Alex Szpakowski from comment # 4)

(In reply to Donovan Watteau from comment # 3)

Upstream likes to provide a good amount of backward compatibility for older
macOS releases, so I'm not sure they will chose to use the 10.14+ SDK.
Maybe this will be worked around by removing NSRequiresAquaSystemAppearance
and missing Dark mode for now, instead.

Compiling with a newer SDK doesn't prevent an app from running on older
operating systems - there's a separate minimum OS target setting from the
current SDK being used, so for example I compile my apps with the 10.15 SDK
and set their minimum deployment target to 10.7, and they'll run on every OS
version between 10.7 and 10.15 (and on newer operating systems when they're
released - just not with every new feature of that new OS version).

The layer backed NSOpenGLView stuff is pretty fragile so I'm not sure I'd
recommend changing how that works for an issue like this, but maybe someone
could find a robust workaround there with some time invested. To me it feels
like a much less ideal solution than just using a newer SDK though.

Yes, sorry, I forgot that.

Unfortunately, after removing any NSRequiresAquaSystemAppearance mention, and building ScummVM 2.2.0git with the 10.14 SDK and targeting either a 10.9 or 10.14 compatibility (the instructions about building it with Xcode are on their Wiki), the app still remains blurry by default on Mojave.

So it looks like the only workaround is to build with a pre-10.14 SDK, and NOT to use NSRequiresAquaSystemAppearance. Otherwise, you get the blurring issues. So this macOS bug looks more problematic.

(I wish I could provide you a simpler use case to reproduce this on 10.14+, but I'm just a ScummVM user, and finding the smallest snippet of code reproducing this issue is above my SDL programming knowledge...)

On 2020-04-27 20:01:21 +0000, Donovan Watteau wrote:

Hi,

To keep you informed: criezy from the ScummVM team found that you can also work around the blurring issue on 10.14+ SDKs by building with a SDK value set to n/a:
https://bugs.scummvm.org/ticket/11430

This comes from LibreOffice, which had a similar issue:
https://bugs.documentfoundation.org/show_bug.cgi?id=122218

I've reported the bug to Apple, but I'm not sure they're going to do something about this.

I don't know if something can be worked around by default in SDL2 in itself, but hopefully this bug report might help documenting this macOS bug.

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

Successfully merging a pull request may close this issue.

None yet
1 participant