vlc/vlc-3.0 | branch: master | David Fuhrmann <[email protected]> | Sun 
Dec 16 20:04:38 2018 +0100| [65b7360a6aac1c6a43e599bbdb6e5f8c1d59d5e1] | 
committer: David Fuhrmann

macosx: Disable automatic switching between dark and bright mode for now

It seems on macOS Mojave, _automatic_ switching between dark and
bright mode automatically opts into layer baked mode, which in
turn changes some internals related to openGL rendering, breaking
the Aspect ratio of the movies (see radar 45895864 for details).

However, manually setting the dark appearance works and does not
break the vout, so lets do that in case the user selected dark
in VLCs preferences.

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=65b7360a6aac1c6a43e599bbdb6e5f8c1d59d5e1
---

 modules/gui/macosx/VLCMain.m                  | 10 ++++++++++
 modules/gui/macosx/VLCSimplePrefsController.m | 23 +++++------------------
 share/Info.plist.in                           |  2 +-
 3 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/modules/gui/macosx/VLCMain.m b/modules/gui/macosx/VLCMain.m
index 8397c0fb5c..b561cd5bf7 100644
--- a/modules/gui/macosx/VLCMain.m
+++ b/modules/gui/macosx/VLCMain.m
@@ -95,6 +95,16 @@ int OpenIntf (vlc_object_t *p_this)
             [VLCApplication sharedApplication];
             [VLCMain sharedInstance];
 
+            if (@available(macOS 10.14, *)) {
+                if (var_InheritBool(getIntf(), "macosx-interfacestyle")) {
+
+                    // Use the native dark appearance style on Mojave
+                    // Automatic switching between both styles does not work 
yet, see commit msg
+                    NSApplication *app = [NSApplication sharedApplication];
+                    app.appearance = [NSAppearance appearanceNamed: 
NSAppearanceNameDarkAqua];
+                }
+            }
+
             [NSBundle loadNibNamed:@"MainMenu" owner:[[VLCMain sharedInstance] 
mainMenu]];
             [[[VLCMain sharedInstance] mainWindow] makeKeyAndOrderFront:nil];
 
diff --git a/modules/gui/macosx/VLCSimplePrefsController.m 
b/modules/gui/macosx/VLCSimplePrefsController.m
index 0096754b0f..8fa8d9383e 100644
--- a/modules/gui/macosx/VLCSimplePrefsController.m
+++ b/modules/gui/macosx/VLCSimplePrefsController.m
@@ -579,25 +579,12 @@ static inline const char * __config_GetLabel(vlc_object_t 
*p_this, const char *p
     BOOL growlEnabled = [self hasModule:@"growl" inConfig:@"control"];
     [_intf_enableNotificationsCheckbox setState: growlEnabled ? NSOnState : 
NSOffState];
 
-    if (@available(macOS 10.14, *)) {
-        _intf_style_darkButtonCell.enabled = NO;
-        _intf_style_brightButtonCell.enabled = NO;
-
-        if ([self.contentView.effectiveAppearance.name 
isEqualToString:NSAppearanceNameDarkAqua]) {
-            [_intf_style_darkButtonCell setState: YES];
-            [_intf_style_brightButtonCell setState: NO];
-        } else {
-            [_intf_style_darkButtonCell setState: NO];
-            [_intf_style_brightButtonCell setState: YES];
-        }
+    if (config_GetInt(p_intf, "macosx-interfacestyle")) {
+        [_intf_style_darkButtonCell setState: YES];
+        [_intf_style_brightButtonCell setState: NO];
     } else {
-        if (config_GetInt(p_intf, "macosx-interfacestyle")) {
-            [_intf_style_darkButtonCell setState: YES];
-            [_intf_style_brightButtonCell setState: NO];
-        } else {
-            [_intf_style_darkButtonCell setState: NO];
-            [_intf_style_brightButtonCell setState: YES];
-        }
+        [_intf_style_darkButtonCell setState: NO];
+        [_intf_style_brightButtonCell setState: YES];
     }
 
     BOOL httpEnabled = [self hasModule:@"http" inConfig:@"extraintf"];
diff --git a/share/Info.plist.in b/share/Info.plist.in
index b6f88bd75d..49fc3a072f 100644
--- a/share/Info.plist.in
+++ b/share/Info.plist.in
@@ -5,7 +5,7 @@
        <key>CFBundleDevelopmentRegion</key>
        <string>English</string>
        <key>NSRequiresAquaSystemAppearance</key>
-       <false/>
+       <true/>
        <key>CFBundleDocumentTypes</key>
        <array>
                <dict>

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to