VirtualBox

Changeset 50647 in vbox


Ignore:
Timestamp:
Feb 28, 2014 8:22:11 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
92545
Message:

FE/Qt: Mac OS X: 7016: Native fullscreen multi-screen support: Fullscreen mode invalidation mechanism improvement (fixing one racing between Qt and cocoa).

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp

    r50646 r50647  
    515515bool UIMachineLogicFullscreen::shouldWeInvalidateFullscreenMode() const
    516516{
    517     /* Prepare result: */
    518     bool fSomethingInvalid = false;
    519 
    520517    /* Enumerate windows: */
    521518    foreach (UIMachineWindow *pMachineWindow, machineWindows())
    522519    {
     520        /* Cast to 'fullscreen' window: */
     521        UIMachineWindowFullscreen *pFullscreenMachineWindow =
     522            qobject_cast<UIMachineWindowFullscreen*>(pMachineWindow);
     523        /* Ignore window(s) which are in 'fullscreen transition': */
     524        if (pFullscreenMachineWindow->isInFullscreenTransition())
     525            continue;
     526
    523527        /* Get screen ID: */
    524528        ulong uScreenID = pMachineWindow->screenId();
     
    533537                if (   uisession()->isScreenVisible(uScreenID)
    534538                    && hasHostScreenForGuestScreen(uScreenID))
    535                 {
    536                     fSomethingInvalid = true;
    537                     break;
    538                 }
     539                    return true;
    539540            }
    540541            /* Check window which is in fullscreen: */
     
    545546                if (   !uisession()->isScreenVisible(uScreenID)
    546547                    || !hasHostScreenForGuestScreen(uScreenID))
    547                 {
    548                     fSomethingInvalid = true;
    549                     break;
    550                 }
     548                    return true;
    551549                /* Check if that window should be located
    552550                 * on another host-screen than currently. */
    553551                if (hostScreenForGuestScreen((int)uScreenID) !=
    554552                    QApplication::desktop()->screenNumber(pMachineWindow))
    555                 {
    556                     fSomethingInvalid = true;
    557                     break;
    558                 }
     553                    return true;
    559554            }
    560555        }
    561556    }
    562557
    563     /* Return result: */
    564     return fSomethingInvalid;
     558    /* False by default: */
     559    return false;
    565560}
    566561
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp

    r50634 r50647  
    4444    , m_pMainMenu(0)
    4545    , m_pMiniToolBar(0)
     46#ifdef Q_WS_MAC
     47    , m_fIsInFullscreenTransition(false)
     48#endif /* Q_WS_MAC */
    4649{
    4750}
     
    5356    AssertReturnVoid(vboxGlobal().osRelease() > MacOSXRelease_Lion);
    5457
    55     /* Handle arrived notification: */
     58    /* Log all arrived notifications: */
    5659    LogRel(("UIMachineWindowFullscreen::handleNativeNotification: Notification '%s' received.\n",
    5760            strNativeNotificationName.toAscii().constData()));
     61
    5862    /* Handle 'NSWindowDidEnterFullScreenNotification' notification: */
    5963    if (strNativeNotificationName == "NSWindowDidEnterFullScreenNotification")
    6064    {
     65        /* Mark window transition complete: */
     66        m_fIsInFullscreenTransition = false;
    6167        LogRel(("UIMachineWindowFullscreen::handleNativeNotification: "
    6268                "Native fullscreen mode entered, notifying listener...\n"));
     
    6672    else if (strNativeNotificationName == "NSWindowDidExitFullScreenNotification")
    6773    {
     74        /* Mark window transition complete: */
     75        m_fIsInFullscreenTransition = false;
    6876        LogRel(("UIMachineWindowFullscreen::handleNativeNotification: "
    6977                "Native fullscreen mode exited, notifying listener...\n"));
     
    110118    if (!pFullscreenLogic->hasHostScreenForGuestScreen(m_uScreenId))
    111119        return;
     120
     121    /* Mark window 'transitioned to fullscreen': */
     122    m_fIsInFullscreenTransition = true;
    112123
    113124    /* Enter native fullscreen mode if necessary: */
     
    121132    /* Make sure this slot is called only under ML and next: */
    122133    AssertReturnVoid(vboxGlobal().osRelease() > MacOSXRelease_Lion);
     134
     135    /* Mark window 'transitioned from fullscreen': */
     136    m_fIsInFullscreenTransition = true;
    123137
    124138    /* Exit native fullscreen mode if necessary: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h

    r50634 r50647  
    3333#ifdef RT_OS_DARWIN
    3434signals:
    35     /** Mac OS X: Notifies listener about native fullscreen entering. */
     35    /** Mac OS X: Notifies listener about native 'fullscreen' entered. */
    3636    void sigNotifyAboutNativeFullscreenDidEnter();
    37     /** Mac OS X: Notifies listener about native fullscreen exiting. */
     37    /** Mac OS X: Notifies listener about native 'fullscreen' exited. */
    3838    void sigNotifyAboutNativeFullscreenDidExit();
    3939#endif /* RT_OS_DARWIN */
     
    4545
    4646#ifdef Q_WS_MAC
    47     /** Mac OS X: Handles native notifications @a strNativeNotificationName for fullscreen window. */
     47    /** Mac OS X: Handles native notifications @a strNativeNotificationName for 'fullscreen' window. */
    4848    void handleNativeNotification(const QString &strNativeNotificationName);
     49    /** Mac OS X: Returns whether window is in 'fullscreen' transition. */
     50    bool isInFullscreenTransition() const { return m_fIsInFullscreenTransition; }
    4951#endif /* Q_WS_MAC */
    5052
     
    8789    UIRuntimeMiniToolBar *m_pMiniToolBar;
    8890
     91#ifdef Q_WS_MAC
     92    /** Mac OS X: Reflects whether window is in 'fullscreen' transition. */
     93    bool m_fIsInFullscreenTransition;
     94    /** Mac OS X: Allows 'fullscreen' API access: */
     95    friend class UIMachineLogicFullscreen;
     96#endif /* Q_WS_MAC */
     97
    8998    /* Factory support: */
    9099    friend class UIMachineWindow;
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