Closed yougotwill closed 5 years ago
From some googling this should be the right direction to solving this issue https://developer.apple.com/documentation/appkit/nsappearancecustomization/choosing_a_specific_appearance_for_your_macos_app
Frankly, this is a bug in macOS which I reported about a year ago to Apple. I don't know how to reference a link to it, but here is a screenshot:
They say it will be fixed in macOS 10.15 (since beta1 19A471t), but I have not verified it yet.
Ok got it thanks @p0deje! Hopefully it will be resolved by apple in future.
I believe you can listen for the system change and manually set the NSApp's appearance at app level to that new value, this should update the menus...
NSDistributedNotificationCenter * dnc = NSDistributedNotificationCenter.defaultCenter; [dnc addObserver:self selector:@selector(systemThemeDidChange:) name:@"AppleInterfaceThemeChangedNotification" object:nil];
then in systemThemeDidChange:
can simply force NSApp's appearance to what the new system one is, seems to fix various bugs.
@curthard89 I don't actually control or listen to appearance change as I merely use NSMenu
and its view handles the appearance bu itself. The only approach to overcome this issue is to actually replace NSMenu
with a custom implementation which is too much IMO.
Hmm, that annoying, another possible way to force it, is to just put a custom NSMenuItem with a view, grab the views window and then set that windows appearance, sketchy but doable :)
@curthard89 I'm not sure how to do properly that and I'm not sure that setting windows appearance will actually draw menu with dark mode. I'll be happy to merge a PR adding this though :)
Seems to be fixed in macOS10.15 Catalina.
Cool, then I'm going to close it, though I haven't updated yet :)
Firstly, thanks for the hard work making this app. It suits my daily needs perfectly! As seen in the title the context menu doesn't respect dark mode.
I attempted to see if this could be solved easily using
defaults write org.p0deje.Maccy NSRequiresAquaSystemAppearance 0
which was something I learned about on the Sublime Text forums. Unfortunately this didn't fix the issue. I don't know enough about Swift to do a PR but if I can help in anyway let me know. :)