[vlc-devel] [PATCH 2/2] macosx: add a nag screen when executing the Intel binary on ARM-64

Felix Paul Kühne fkuehne at videolan.org
Mon Nov 30 18:48:21 CET 2020


Hi Marvin,

> Am 30.11.2020 um 17:42 schrieb Marvin Scholz <epirat07 at gmail.com>:
> 
> On 30 Nov 2020, at 17:20, Felix Paul Kühne wrote:
> 
>> From: Felix Paul Kühne <felix at feepk.net>
>> 
>> ---
>> modules/gui/macosx/VLCMain.m | 40 +++++++++++++++++++++++++++++++++++-
>> 1 file changed, 39 insertions(+), 1 deletion(-)
>> 
>> diff --git a/modules/gui/macosx/VLCMain.m b/modules/gui/macosx/VLCMain.m
>> index 3e08c48da9..6668ea456d 100644
>> --- a/modules/gui/macosx/VLCMain.m
>> +++ b/modules/gui/macosx/VLCMain.m
>> @@ -1,7 +1,7 @@
>> /*****************************************************************************
>>  * VLCMain.m: MacOS X interface module
>>  *****************************************************************************
>> - * Copyright (C) 2002-2016 VLC authors and VideoLAN
>> + * Copyright (C) 2002-2020 VLC authors and VideoLAN
>>  * $Id$
>>  *
>>  * Authors: Derk-Jan Hartman <hartman at videolan.org>
>> @@ -35,6 +35,7 @@
>> 
>> #include <stdlib.h>                                      /* malloc(), free() */
>> #include <string.h>
>> +#include <sys/sysctl.h>
>> #include <vlc_common.h>
>> #include <vlc_atomic.h>
>> #include <vlc_actions.h>
>> @@ -319,6 +320,43 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
>>     if (kidsAround && var_GetBool(p_playlist, "playlist-autostart"))
>>         playlist_Control(p_playlist, PLAYLIST_PLAY, true);
>>     PL_UNLOCK;
>> +
>> +    /* on macOS 11 and later, check whether the user attempts to deploy
>> +     * the x86_64 binary on ARM-64 - if yes, run a nag screen */
>> +    if (OSX_BIGSUR_AND_HIGHER) {
>> +        if ([self processIsTranslated] > 0) {
>> +            msg_Warn(p_intf, "Process is translated!");
>> +            [self runNagScreen];
>> +        }
>> +    }
> 
> I think it makes sense to log it, but I am against adding a nag screen
> for this, especially without a way to turn it off.

Should we add a third choice aka „never annoy again“? 

> 
>> +}
>> +
>> +- (int)processIsTranslated
>> +{
>> +   int ret = 0;
>> +   size_t size = sizeof(ret);
>> +   if (sysctlbyname("sysctl.proc_translated", &ret, &size, NULL, 0) == -1) {
>> +      if (errno == ENOENT)
>> +         return 0;
>> +      return -1;
>> +   }
>> +   return ret;
>> +}
>> +
>> +- (void)runNagScreen
>> +{
>> +    NSAlert *alert = [NSAlert alertWithMessageText:_NS("VLC runs in translation mode")
>> +                                     defaultButton:_NS("Download native version")
> 
> The button should be titled "Open Website" as that is what it does.

Good point.

In general, I would favor such a screen because people will download the wrong version, they just will, especially if we decide not to release a universal binary of VLC as the major means of distribution for macOS. The speed penalty is significant when using the Intel binary on ARM-64.

Another option would be to silently bridge Intel-binary installations on ARM-Macs for the subsequent release of .12 to their native binary using Sparkle. We could also do both.

Opinions wanted :)

Cheers,

Felix



More information about the vlc-devel mailing list