VirtualBox

Changeset 98885 in vbox


Ignore:
Timestamp:
Mar 9, 2023 9:58:41 AM (21 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10382: macOS: Removing workarounds for old macOS versions since Snow Leopard till El Capitan.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp

    r98808 r98885  
    189189    , m_fDataCommitted(false)
    190190#endif
    191 #ifdef VBOX_WS_MAC
    192     , m_enmMacOSVersion(MacOSXRelease_Old)
    193 #endif
    194191#ifdef VBOX_WS_X11
    195192    , m_enmWindowManagerType(X11WMType_Unknown)
     
    244241            this, &UICommon::sltHandleCommitDataRequest);
    245242#endif /* VBOX_GUI_WITH_CUSTOMIZATIONS1 */
    246 
    247 #ifdef VBOX_WS_MAC
    248     /* Determine OS release early: */
    249     m_enmMacOSVersion = determineOsRelease();
    250 #endif /* VBOX_WS_MAC */
    251243
    252244    /* Create converter: */
     
    945937    return settings.value(QString("%1").arg(strKey)).toString();
    946938}
    947 
    948 #ifdef VBOX_WS_MAC
    949 /* static */
    950 MacOSXRelease UICommon::determineOsRelease()
    951 {
    952     /* Prepare 'utsname' struct: */
    953     utsname info;
    954     if (uname(&info) != -1)
    955     {
    956         /* Compose map of known releases: */
    957         QMap<int, MacOSXRelease> release;
    958         release[10] = MacOSXRelease_SnowLeopard;
    959         release[11] = MacOSXRelease_Lion;
    960         release[12] = MacOSXRelease_MountainLion;
    961         release[13] = MacOSXRelease_Mavericks;
    962         release[14] = MacOSXRelease_Yosemite;
    963         release[15] = MacOSXRelease_ElCapitan;
    964 
    965         /* Cut the major release index of the string we have, s.a. 'man uname': */
    966         const int iRelease = QString(info.release).section('.', 0, 0).toInt();
    967 
    968         /* Return release if determined, return 'New' if version more recent than latest, return 'Old' otherwise: */
    969         return release.value(iRelease, iRelease > release.keys().last() ? MacOSXRelease_New : MacOSXRelease_Old);
    970     }
    971     /* Return 'Old' by default: */
    972     return MacOSXRelease_Old;
    973 }
    974 #endif /* VBOX_WS_MAC */
    975939
    976940#ifdef VBOX_WS_WIN
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h

    r98808 r98885  
    205205    /** @name Host OS stuff.
    206206     * @{ */
    207 #ifdef VBOX_WS_MAC
    208         /** Mac OS X: Returns #MacOSXRelease determined by <i>uname</i> call. */
    209         static MacOSXRelease determineOsRelease();
    210         /** Mac OS X: Returns #MacOSXRelease determined during UICommon prepare routine. */
    211         MacOSXRelease osRelease() const { return m_enmMacOSVersion; }
    212 #endif
    213 
    214207#ifdef VBOX_WS_WIN
    215208        /** Loads the color theme. */
     
    649642    /** @name Host OS stuff.
    650643     * @{ */
    651 #ifdef VBOX_WS_MAC
    652         /** Mac OS X: Holds the #MacOSXRelease determined using <i>uname</i> call. */
    653         MacOSXRelease  m_enmMacOSVersion;
    654 #endif
    655 
    656644#ifdef VBOX_WS_X11
    657645        /** X11: Holds the #X11WMType of the Window Manager we are running under. */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h

    r98335 r98885  
    9898
    9999
    100 #ifdef VBOX_WS_MAC
    101 /** Known macOS releases. */
    102 enum MacOSXRelease
    103 {
    104     MacOSXRelease_Old,
    105     MacOSXRelease_SnowLeopard,
    106     MacOSXRelease_Lion,
    107     MacOSXRelease_MountainLion,
    108     MacOSXRelease_Mavericks,
    109     MacOSXRelease_Yosemite,
    110     MacOSXRelease_ElCapitan,
    111     MacOSXRelease_New,
    112 };
    113 #endif /* VBOX_WS_MAC */
    114 
    115 
    116100/** Size suffixes. */
    117101enum SizeSuffix
  • trunk/src/VBox/Frontends/VirtualBox/src/main.cpp

    r98882 r98885  
    426426
    427427#ifdef VBOX_WS_MAC
    428         /* Apply font fixes (before QApplication get created and instantiated font-hints): */
    429         switch (UICommon::determineOsRelease())
    430         {
    431             case MacOSXRelease_Mavericks: QFont::insertSubstitution(".Lucida Grande UI", "Lucida Grande"); break;
    432             case MacOSXRelease_Yosemite:  QFont::insertSubstitution(".Helvetica Neue DeskInterface", "Helvetica Neue"); break;
    433             case MacOSXRelease_ElCapitan: QFont::insertSubstitution(".SF NS Text", "Helvetica Neue"); break;
    434             default: break;
    435         }
    436 
    437428        /* Instantiate own NSApplication before QApplication do it for us: */
    438429        UICocoaApplication::instance();
     
    451442            QCoreApplication::addLibraryPath(QString::fromUtf8(szExecDir));
    452443        }
    453 # endif
     444# endif /* VBOX_RUNTIME_UI */
    454445#endif /* VBOX_WS_MAC */
    455446
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp

    r98849 r98885  
    110110    Q_UNUSED(uScreenId);
    111111#ifdef VBOX_WS_MAC
    112     return uiCommon().osRelease() <= MacOSXRelease_Lion ? Qt::FramelessWindowHint :
    113            uScreenId == 0 || screensHaveSeparateSpaces() ? Qt::Window : Qt::FramelessWindowHint;
     112    return uScreenId == 0 || screensHaveSeparateSpaces() ? Qt::Window : Qt::FramelessWindowHint;
    114113#else /* !VBOX_WS_MAC */
    115114    return Qt::FramelessWindowHint;
     
    125124
    126125#ifdef VBOX_WS_MAC
    127     /* For Lion and previous: */
    128     if (uiCommon().osRelease() <= MacOSXRelease_Lion)
    129     {
    130         /* Make sure all machine-window(s) have proper geometry: */
    131         foreach (UIMachineWindow *pMachineWindow, machineWindows())
    132             pMachineWindow->showInNecessaryMode();
    133     }
    134     /* For ML and next revalidate native fullscreen: */
    135     else revalidateNativeFullScreen();
     126    /* Revalidate native fullscreen: */
     127    revalidateNativeFullScreen();
    136128#else /* !VBOX_WS_MAC */
    137129    /* Make sure all machine-window(s) have proper geometry: */
     
    144136void UIMachineLogicFullscreen::sltHandleNativeFullscreenWillEnter()
    145137{
    146     /* Make sure this method is only used for ML and next: */
    147     AssertReturnVoid(uiCommon().osRelease() > MacOSXRelease_Lion);
    148 
    149138    /* Get sender machine-window: */
    150139    UIMachineWindow *pMachineWindow = qobject_cast<UIMachineWindow*>(sender());
     
    157146void UIMachineLogicFullscreen::sltHandleNativeFullscreenDidEnter()
    158147{
    159     /* Make sure this method is only used for ML and next: */
    160     AssertReturnVoid(uiCommon().osRelease() > MacOSXRelease_Lion);
    161 
    162148    /* Get sender machine-window: */
    163149    UIMachineWindow *pMachineWindow = qobject_cast<UIMachineWindow*>(sender());
     
    179165void UIMachineLogicFullscreen::sltHandleNativeFullscreenWillExit()
    180166{
    181     /* Make sure this method is only used for ML and next: */
    182     AssertReturnVoid(uiCommon().osRelease() > MacOSXRelease_Lion);
    183 
    184167    /* Get sender machine-window: */
    185168    UIMachineWindow *pMachineWindow = qobject_cast<UIMachineWindow*>(sender());
     
    192175void UIMachineLogicFullscreen::sltHandleNativeFullscreenDidExit()
    193176{
    194     /* Make sure this method is only used for ML and next: */
    195     AssertReturnVoid(uiCommon().osRelease() > MacOSXRelease_Lion);
    196 
    197177    /* Get sender machine-window: */
    198178    UIMachineWindow *pMachineWindow = qobject_cast<UIMachineWindow*>(sender());
     
    257237void UIMachineLogicFullscreen::sltHandleNativeFullscreenFailToEnter()
    258238{
    259     /* Make sure this method is only used for ML and next: */
    260     AssertReturnVoid(uiCommon().osRelease() > MacOSXRelease_Lion);
    261 
    262239    /* Get sender machine-window: */
    263240    UIMachineWindow *pMachineWindow = qobject_cast<UIMachineWindow*>(sender());
     
    296273void UIMachineLogicFullscreen::sltChangeVisualStateToNormal()
    297274{
    298     /* Base-class handling for Lion and previous: */
    299     if (uiCommon().osRelease() <= MacOSXRelease_Lion)
    300         UIMachineLogic::sltChangeVisualStateToNormal();
    301     /* Special handling for ML and next: */
    302     else
    303     {
    304         /* Request 'normal' (window) visual-state: */
    305         uimachine()->setRequestedVisualState(UIVisualStateType_Normal);
    306         /* Ask window(s) to exit 'fullscreen' mode: */
    307         emit sigNotifyAboutNativeFullscreenShouldBeExited();
    308     }
     275    /* Request 'normal' (window) visual-state: */
     276    uimachine()->setRequestedVisualState(UIVisualStateType_Normal);
     277    /* Ask window(s) to exit 'fullscreen' mode: */
     278    emit sigNotifyAboutNativeFullscreenShouldBeExited();
    309279}
    310280
    311281void UIMachineLogicFullscreen::sltChangeVisualStateToSeamless()
    312282{
    313     /* Base-class handling for Lion and previous: */
    314     if (uiCommon().osRelease() <= MacOSXRelease_Lion)
    315         UIMachineLogic::sltChangeVisualStateToSeamless();
    316     /* Special handling for ML and next: */
    317     else
    318     {
    319         /* Request 'seamless' visual-state: */
    320         uimachine()->setRequestedVisualState(UIVisualStateType_Seamless);
    321         /* Ask window(s) to exit 'fullscreen' mode: */
    322         emit sigNotifyAboutNativeFullscreenShouldBeExited();
    323     }
     283    /* Request 'seamless' visual-state: */
     284    uimachine()->setRequestedVisualState(UIVisualStateType_Seamless);
     285    /* Ask window(s) to exit 'fullscreen' mode: */
     286    emit sigNotifyAboutNativeFullscreenShouldBeExited();
    324287}
    325288
    326289void UIMachineLogicFullscreen::sltChangeVisualStateToScale()
    327290{
    328     /* Base-class handling for Lion and previous: */
    329     if (uiCommon().osRelease() <= MacOSXRelease_Lion)
    330         UIMachineLogic::sltChangeVisualStateToScale();
    331     /* Special handling for ML and next: */
    332     else
    333     {
    334         /* Request 'scale' visual-state: */
    335         uimachine()->setRequestedVisualState(UIVisualStateType_Scale);
    336         /* Ask window(s) to exit 'fullscreen' mode: */
    337         emit sigNotifyAboutNativeFullscreenShouldBeExited();
    338     }
     291    /* Request 'scale' visual-state: */
     292    uimachine()->setRequestedVisualState(UIVisualStateType_Scale);
     293    /* Ask window(s) to exit 'fullscreen' mode: */
     294    emit sigNotifyAboutNativeFullscreenShouldBeExited();
    339295}
    340296
     
    404360
    405361#ifdef VBOX_WS_MAC
    406     /* For Lion and previous: */
    407     if (uiCommon().osRelease() <= MacOSXRelease_Lion)
    408     {
    409         /* Make sure all machine-window(s) have proper geometry: */
    410         foreach (UIMachineWindow *pMachineWindow, machineWindows())
    411             pMachineWindow->showInNecessaryMode();
    412     }
    413     /* Revalidate native fullscreen for ML and next: */
    414     else revalidateNativeFullScreen();
     362    /* Revalidate native fullscreen: */
     363    revalidateNativeFullScreen();
    415364#else /* !VBOX_WS_MAC */
    416365    /* Make sure all machine-window(s) have proper geometry: */
     
    428377
    429378#ifdef VBOX_WS_MAC
    430     /* Call to base-class for Lion and previous: */
    431     if (uiCommon().osRelease() <= MacOSXRelease_Lion)
    432         UIMachineLogic::sltGuestMonitorChange(changeType, uScreenId, screenGeo);
    433     /* Revalidate native fullscreen for ML and next: */
    434     else revalidateNativeFullScreen();
     379    /* Revalidate native fullscreen: */
     380    RT_NOREF(changeType, uScreenId, screenGeo);
     381    revalidateNativeFullScreen();
    435382#else /* !VBOX_WS_MAC */
    436383    /* Call to base-class: */
     
    447394
    448395#ifdef VBOX_WS_MAC
    449     /* Call to base-class for Lion and previous: */
    450     if (uiCommon().osRelease() <= MacOSXRelease_Lion)
    451         UIMachineLogic::sltHostScreenCountChange();
    452     /* Revalidate native fullscreen for ML and next: */
    453     else revalidateNativeFullScreen();
     396    /* Revalidate native fullscreen: */
     397    revalidateNativeFullScreen();
    454398#else /* !VBOX_WS_MAC */
    455399    /* Call to base-class: */
     
    522466
    523467#ifdef VBOX_WS_MAC
    524     /* For ML and next: */
    525     if (uiCommon().osRelease() > MacOSXRelease_Lion)
    526     {
    527         /* Register to native notifications: */
    528         UICocoaApplication::instance()->registerToNotificationOfWorkspace("NSWorkspaceDidActivateApplicationNotification", this,
    529                                                                           UIMachineLogicFullscreen::nativeHandlerForApplicationActivation);
    530         UICocoaApplication::instance()->registerToNotificationOfWorkspace("NSWorkspaceActiveSpaceDidChangeNotification", this,
    531                                                                           UIMachineLogicFullscreen::nativeHandlerForActiveSpaceChange);
    532     }
     468    /* Register to native notifications: */
     469    UICocoaApplication::instance()->registerToNotificationOfWorkspace("NSWorkspaceDidActivateApplicationNotification", this,
     470                                                                      UIMachineLogicFullscreen::nativeHandlerForApplicationActivation);
     471    UICocoaApplication::instance()->registerToNotificationOfWorkspace("NSWorkspaceActiveSpaceDidChangeNotification", this,
     472                                                                      UIMachineLogicFullscreen::nativeHandlerForActiveSpaceChange);
    533473
    534474    /* We have to make sure that we are getting the front most process.
     
    553493
    554494#ifdef VBOX_WS_MAC
    555     /* For ML and next: */
    556     if (uiCommon().osRelease() > MacOSXRelease_Lion)
    557     {
    558         /* Enable native fullscreen support: */
    559         foreach (UIMachineWindow *pMachineWindow, machineWindows())
    560         {
    561             UIMachineWindowFullscreen *pMachineWindowFullscreen = qobject_cast<UIMachineWindowFullscreen*>(pMachineWindow);
    562             if (!pMachineWindow)
    563                 continue;
    564             /* Logic => window signals: */
    565             connect(this, &UIMachineLogicFullscreen::sigNotifyAboutNativeFullscreenShouldBeEntered,
    566                     pMachineWindowFullscreen, &UIMachineWindowFullscreen::sltEnterNativeFullscreen);
    567             connect(this, &UIMachineLogicFullscreen::sigNotifyAboutNativeFullscreenShouldBeExited,
    568                     pMachineWindowFullscreen, &UIMachineWindowFullscreen::sltExitNativeFullscreen);
    569             /* Window => logic signals: */
    570             connect(pMachineWindowFullscreen, &UIMachineWindowFullscreen::sigNotifyAboutNativeFullscreenWillEnter,
    571                     this, &UIMachineLogicFullscreen::sltHandleNativeFullscreenWillEnter,
    572                      Qt::QueuedConnection);
    573             connect(pMachineWindowFullscreen, &UIMachineWindowFullscreen::sigNotifyAboutNativeFullscreenDidEnter,
    574                     this, &UIMachineLogicFullscreen::sltHandleNativeFullscreenDidEnter,
    575                     Qt::QueuedConnection);
    576             connect(pMachineWindowFullscreen, &UIMachineWindowFullscreen::sigNotifyAboutNativeFullscreenWillExit,
    577                     this, &UIMachineLogicFullscreen::sltHandleNativeFullscreenWillExit,
    578                     Qt::QueuedConnection);
    579             connect(pMachineWindowFullscreen, &UIMachineWindowFullscreen::sigNotifyAboutNativeFullscreenDidExit,
    580                     this, &UIMachineLogicFullscreen::sltHandleNativeFullscreenDidExit,
    581                     Qt::QueuedConnection);
    582             connect(pMachineWindowFullscreen, &UIMachineWindowFullscreen::sigNotifyAboutNativeFullscreenFailToEnter,
    583                     this, &UIMachineLogicFullscreen::sltHandleNativeFullscreenFailToEnter,
    584                     Qt::QueuedConnection);
    585         }
    586         /* Revalidate native fullscreen: */
    587         revalidateNativeFullScreen();
    588     }
     495    /* Enable native fullscreen support: */
     496    foreach (UIMachineWindow *pMachineWindow, machineWindows())
     497    {
     498        UIMachineWindowFullscreen *pMachineWindowFullscreen = qobject_cast<UIMachineWindowFullscreen*>(pMachineWindow);
     499        if (!pMachineWindow)
     500            continue;
     501        /* Logic => window signals: */
     502        connect(this, &UIMachineLogicFullscreen::sigNotifyAboutNativeFullscreenShouldBeEntered,
     503                pMachineWindowFullscreen, &UIMachineWindowFullscreen::sltEnterNativeFullscreen);
     504        connect(this, &UIMachineLogicFullscreen::sigNotifyAboutNativeFullscreenShouldBeExited,
     505                pMachineWindowFullscreen, &UIMachineWindowFullscreen::sltExitNativeFullscreen);
     506        /* Window => logic signals: */
     507        connect(pMachineWindowFullscreen, &UIMachineWindowFullscreen::sigNotifyAboutNativeFullscreenWillEnter,
     508                this, &UIMachineLogicFullscreen::sltHandleNativeFullscreenWillEnter,
     509                 Qt::QueuedConnection);
     510        connect(pMachineWindowFullscreen, &UIMachineWindowFullscreen::sigNotifyAboutNativeFullscreenDidEnter,
     511                this, &UIMachineLogicFullscreen::sltHandleNativeFullscreenDidEnter,
     512                Qt::QueuedConnection);
     513        connect(pMachineWindowFullscreen, &UIMachineWindowFullscreen::sigNotifyAboutNativeFullscreenWillExit,
     514                this, &UIMachineLogicFullscreen::sltHandleNativeFullscreenWillExit,
     515                Qt::QueuedConnection);
     516        connect(pMachineWindowFullscreen, &UIMachineWindowFullscreen::sigNotifyAboutNativeFullscreenDidExit,
     517                this, &UIMachineLogicFullscreen::sltHandleNativeFullscreenDidExit,
     518                Qt::QueuedConnection);
     519        connect(pMachineWindowFullscreen, &UIMachineWindowFullscreen::sigNotifyAboutNativeFullscreenFailToEnter,
     520                this, &UIMachineLogicFullscreen::sltHandleNativeFullscreenFailToEnter,
     521                Qt::QueuedConnection);
     522    }
     523    /* Revalidate native fullscreen: */
     524    revalidateNativeFullScreen();
    589525#endif /* VBOX_WS_MAC */
    590526
     
    637573
    638574#ifdef VBOX_WS_MAC
    639     /* For ML and next: */
    640     if (uiCommon().osRelease() > MacOSXRelease_Lion)
    641     {
    642         /* Unregister from native notifications: */
    643         UICocoaApplication::instance()->unregisterFromNotificationOfWorkspace("NSWorkspaceDidActivateApplicationNotification", this);
    644         UICocoaApplication::instance()->unregisterFromNotificationOfWorkspace("NSWorkspaceActiveSpaceDidChangeNotification", this);
    645     }
     575    /* Unregister from native notifications: */
     576    UICocoaApplication::instance()->unregisterFromNotificationOfWorkspace("NSWorkspaceDidActivateApplicationNotification", this);
     577    UICocoaApplication::instance()->unregisterFromNotificationOfWorkspace("NSWorkspaceActiveSpaceDidChangeNotification", this);
    646578#endif/* VBOX_WS_MAC */
    647579
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp

    r98675 r98885  
    7474void UIMachineWindowFullscreen::handleNativeNotification(const QString &strNativeNotificationName)
    7575{
    76     /* Make sure this method is only used for ML and next: */
    77     AssertReturnVoid(uiCommon().osRelease() > MacOSXRelease_Lion);
    78 
    7976    /* Log all arrived notifications: */
    8077    LogRel(("UIMachineWindowFullscreen::handleNativeNotification: Notification '%s' received.\n",
     
    170167void UIMachineWindowFullscreen::sltEnterNativeFullscreen(UIMachineWindow *pMachineWindow)
    171168{
    172     /* Make sure this slot is called only under ML and next: */
    173     AssertReturnVoid(uiCommon().osRelease() > MacOSXRelease_Lion);
    174 
    175169    /* Make sure it is NULL or 'this' window passed: */
    176170    if (pMachineWindow && pMachineWindow != this)
     
    197191void UIMachineWindowFullscreen::sltExitNativeFullscreen(UIMachineWindow *pMachineWindow)
    198192{
    199     /* Make sure this slot is called only under ML and next: */
    200     AssertReturnVoid(uiCommon().osRelease() > MacOSXRelease_Lion);
    201 
    202193    /* Make sure it is NULL or 'this' window passed: */
    203194    if (pMachineWindow && pMachineWindow != this)
     
    252243
    253244#ifdef VBOX_WS_MAC
    254     /* Native fullscreen stuff on ML and next: */
    255     if (uiCommon().osRelease() > MacOSXRelease_Lion)
    256     {
    257         /* Make sure this window has fullscreen logic: */
    258         UIMachineLogicFullscreen *pFullscreenLogic = qobject_cast<UIMachineLogicFullscreen*>(machineLogic());
    259         AssertPtrReturnVoid(pFullscreenLogic);
    260         /* Enable fullscreen support for every screen which requires it: */
    261         if (pFullscreenLogic->screensHaveSeparateSpaces() || m_uScreenId == 0)
    262             darwinEnableFullscreenSupport(this);
    263         /* Enable transience support for other screens: */
    264         else
    265             darwinEnableTransienceSupport(this);
    266         /* Register to native fullscreen notifications: */
    267         UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowWillEnterFullScreenNotification", this,
    268                                                                        UIMachineWindow::handleNativeNotification);
    269         UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowDidEnterFullScreenNotification", this,
    270                                                                        UIMachineWindow::handleNativeNotification);
    271         UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowWillExitFullScreenNotification", this,
    272                                                                        UIMachineWindow::handleNativeNotification);
    273         UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowDidExitFullScreenNotification", this,
    274                                                                        UIMachineWindow::handleNativeNotification);
    275         UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowDidFailToEnterFullScreenNotification", this,
    276                                                                        UIMachineWindow::handleNativeNotification);
    277 }
     245    /* Make sure this window has fullscreen logic: */
     246    UIMachineLogicFullscreen *pFullscreenLogic = qobject_cast<UIMachineLogicFullscreen*>(machineLogic());
     247    AssertPtrReturnVoid(pFullscreenLogic);
     248    /* Enable fullscreen support for every screen which requires it: */
     249    if (pFullscreenLogic->screensHaveSeparateSpaces() || m_uScreenId == 0)
     250        darwinEnableFullscreenSupport(this);
     251    /* Enable transience support for other screens: */
     252    else
     253        darwinEnableTransienceSupport(this);
     254    /* Register to native fullscreen notifications: */
     255    UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowWillEnterFullScreenNotification", this,
     256                                                                   UIMachineWindow::handleNativeNotification);
     257    UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowDidEnterFullScreenNotification", this,
     258                                                                   UIMachineWindow::handleNativeNotification);
     259    UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowWillExitFullScreenNotification", this,
     260                                                                   UIMachineWindow::handleNativeNotification);
     261    UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowDidExitFullScreenNotification", this,
     262                                                                   UIMachineWindow::handleNativeNotification);
     263    UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowDidFailToEnterFullScreenNotification", this,
     264                                                                   UIMachineWindow::handleNativeNotification);
    278265#endif /* VBOX_WS_MAC */
    279266}
     
    322309{
    323310#ifdef VBOX_WS_MAC
    324     /* Native fullscreen stuff on ML and next: */
    325     if (uiCommon().osRelease() > MacOSXRelease_Lion)
    326     {
    327         /* Unregister from native fullscreen notifications: */
    328         UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowWillEnterFullScreenNotification", this);
    329         UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowDidEnterFullScreenNotification", this);
    330         UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowWillExitFullScreenNotification", this);
    331         UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowDidExitFullScreenNotification", this);
    332         UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowDidFailToEnterFullScreenNotification", this);
    333     }
     311    /* Unregister from native fullscreen notifications: */
     312    UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowWillEnterFullScreenNotification", this);
     313    UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowDidEnterFullScreenNotification", this);
     314    UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowWillExitFullScreenNotification", this);
     315    UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowDidExitFullScreenNotification", this);
     316    UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowDidFailToEnterFullScreenNotification", this);
    334317#endif /* VBOX_WS_MAC */
    335318
     
    366349    move(workingArea.topLeft());
    367350
    368     /* Resize window to the appropriate size on Lion and previous: */
    369     if (uiCommon().osRelease() <= MacOSXRelease_Lion)
    370         resize(workingArea.size());
    371     /* Resize window to the appropriate size on ML and next if it's screen has no own user-space: */
    372     else if (!pFullscreenLogic->screensHaveSeparateSpaces() && m_uScreenId != 0)
     351    /* Resize window to the appropriate size if it's screen has no own user-space: */
     352    if (!pFullscreenLogic->screensHaveSeparateSpaces() && m_uScreenId != 0)
    373353        resize(workingArea.size());
    374354    /* Resize the window if we are already in the full screen mode. This covers cases like host-resolution changes while in full screen mode: */
    375     else if(darwinIsInFullscreenMode(this))
     355    else if (darwinIsInFullscreenMode(this))
    376356        resize(workingArea.size());
    377357    else
     
    443423        placeOnScreen();
    444424
    445         /* Simple show() for ML and next, showFullScreen() otherwise: */
    446         if (uiCommon().osRelease() > MacOSXRelease_Lion)
    447             show();
    448         else
    449             showFullScreen();
     425        /* Just show instead of showFullScreen: */
     426        show();
    450427
    451428        /* Adjust machine-view size if necessary: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r98859 r98885  
    363363    }
    364364
    365     /* For 'Yosemite' and above: */
    366     if (uiCommon().osRelease() >= MacOSXRelease_Yosemite)
    367     {
    368         /* Enable fullscreen support for every screen which requires it: */
    369         if (darwinScreensHaveSeparateSpaces() || m_uScreenId == 0)
    370             darwinEnableFullscreenSupport(this);
    371         /* Register 'Zoom' button to use our full-screen: */
    372         UICocoaApplication::instance()->registerCallbackForStandardWindowButton(this, StandardWindowButtonType_Zoom,
    373                                                                                 UIMachineWindow::handleStandardWindowButtonCallback);
    374     }
     365    /* Enable fullscreen support for every screen which requires it: */
     366    if (darwinScreensHaveSeparateSpaces() || m_uScreenId == 0)
     367        darwinEnableFullscreenSupport(this);
     368    /* Register 'Zoom' button to use our full-screen: */
     369    UICocoaApplication::instance()->registerCallbackForStandardWindowButton(this, StandardWindowButtonType_Zoom,
     370                                                                            UIMachineWindow::handleStandardWindowButtonCallback);
    375371#endif /* VBOX_WS_MAC */
    376372}
     
    443439{
    444440#ifdef VBOX_WS_MAC
    445     /* Unregister 'Zoom' button from using our full-screen since Yosemite: */
    446     if (uiCommon().osRelease() >= MacOSXRelease_Yosemite)
    447         UICocoaApplication::instance()->unregisterCallbackForStandardWindowButton(this, StandardWindowButtonType_Zoom);
     441    /* Unregister 'Zoom' button from using our full-screen: */
     442    UICocoaApplication::instance()->unregisterCallbackForStandardWindowButton(this, StandardWindowButtonType_Zoom);
    448443#endif /* VBOX_WS_MAC */
    449444}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.cpp

    r98419 r98885  
    8888    }
    8989
    90     /* For 'Yosemite' and above: */
    91     if (uiCommon().osRelease() >= MacOSXRelease_Yosemite)
    92     {
    93         /* Enable fullscreen support for every screen which requires it: */
    94         if (darwinScreensHaveSeparateSpaces() || m_uScreenId == 0)
    95             darwinEnableFullscreenSupport(this);
    96         /* Register 'Zoom' button to use our full-screen: */
    97         UICocoaApplication::instance()->registerCallbackForStandardWindowButton(this, StandardWindowButtonType_Zoom,
    98                                                                                 UIMachineWindow::handleStandardWindowButtonCallback);
    99     }
     90    /* Enable fullscreen support for every screen which requires it: */
     91    if (darwinScreensHaveSeparateSpaces() || m_uScreenId == 0)
     92        darwinEnableFullscreenSupport(this);
     93    /* Register 'Zoom' button to use our full-screen: */
     94    UICocoaApplication::instance()->registerCallbackForStandardWindowButton(this, StandardWindowButtonType_Zoom,
     95                                                                            UIMachineWindow::handleStandardWindowButtonCallback);
    10096}
    10197#endif /* VBOX_WS_MAC */
     
    151147void UIMachineWindowScale::cleanupVisualState()
    152148{
    153     /* Unregister 'Zoom' button from using our full-screen since Yosemite: */
    154     if (uiCommon().osRelease() >= MacOSXRelease_Yosemite)
    155         UICocoaApplication::instance()->unregisterCallbackForStandardWindowButton(this, StandardWindowButtonType_Zoom);
     149    /* Unregister 'Zoom' button from using our full-screen: */
     150    UICocoaApplication::instance()->unregisterCallbackForStandardWindowButton(this, StandardWindowButtonType_Zoom);
    156151}
    157152#endif /* VBOX_WS_MAC */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette