VirtualBox

Changeset 7918 in vbox


Ignore:
Timestamp:
Apr 11, 2008 1:48:38 PM (17 years ago)
Author:
vboxsync
Message:

FE/Qt4-OSX: Fixed seamless mode on Mac OS X.

Location:
trunk/src/VBox/Frontends/VirtualBox4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxConsoleWnd.h

    r7680 r7918  
    189189    void exitSeamless();
    190190
     191    void switchToFullscreen (bool aOn, bool aSeamless);
    191192    void setViewInSeamlessMode (const QRect &aTargetRect);
    192193
     
    338339
    339340#ifdef Q_WS_MAC
    340     // Dock images.
     341    /* For seamless maximizing */
     342    QRect mNormalGeometry;
     343    Qt::WindowFlags mSavedFlags;
     344    /* Dock images */
    341345    CGImageRef dockImgStatePaused;
    342346    CGImageRef dockImgStateSaving;
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleWnd.cpp

    r7871 r7918  
    21032103        }
    21042104
    2105 #ifdef Q_WS_MAC
    2106         if (!aSeamless)
    2107         {
    2108             /* Make the apple menu bar go away before setMaximumSize! */
    2109             OSStatus orc = SetSystemUIMode (kUIModeAllHidden, kUIOptionDisableAppleMenu);
    2110             if (orc)
    2111                 LogRel (("Error: Failed to change UI mode (rc=%#x) when changing to fullscreen mode. (=> menu bar trouble)\n", orc));
    2112         }
    2113 #endif
    2114 
    21152105        /* Adjust colors and appearance. */
    21162106        mErasePalette = centralWidget()->palette();
     
    21262116
    21272117        /* Going fullscreen */
    2128         setWindowState (windowState() ^ Qt::WindowFullScreen);
     2118        switchToFullscreen (aOn, aSeamless);
    21292119#ifdef Q_WS_MAC /* setMask seems to not include the far border pixels. */
    21302120//        QRect maskRect = dtw->screenGeometry (this);
     
    22312221
    22322222        /* Going normal || maximized */
    2233         setWindowState (windowState() ^ Qt::WindowFullScreen);
     2223        switchToFullscreen (aOn, aSeamless);
    22342224
    22352225        qApp->processEvents();
     
    22672257// Private slots
    22682258/////////////////////////////////////////////////////////////////////////////
     2259void VBoxConsoleWnd::switchToFullscreen (bool aOn, bool aSeamless)
     2260{
     2261#ifdef Q_WS_MAC
     2262    if (aSeamless)
     2263        if (aOn)
     2264        {
     2265            /* Save for later restoring */
     2266            mNormalGeometry = geometry();
     2267            mSavedFlags = windowFlags();
     2268            /* Remove the frame from the window */
     2269            setParent (0, Qt::Window | Qt::FramelessWindowHint | (windowFlags() & 0xffff0000));
     2270            /* Set it maximized */
     2271            setWindowState (windowState() ^ Qt::WindowMaximized);
     2272        }
     2273        else
     2274        {
     2275            /* Restore old values */
     2276            setParent (0, mSavedFlags);
     2277            setGeometry (mNormalGeometry);
     2278        }
     2279    else
     2280        /* Here we are going really fullscreen */
     2281        setWindowState (windowState() ^ Qt::WindowFullScreen);
     2282#else
     2283    NOREF (aOn);
     2284    NOREF (aSeamless);
     2285    setWindowState (windowState() ^ Qt::WindowFullScreen);
     2286#endif
     2287}
     2288
    22692289void VBoxConsoleWnd::setViewInSeamlessMode (const QRect &aTargetRect)
    22702290{
     2291#ifndef Q_WS_MAC
    22712292    if (mIsSeamless)
    22722293    {
     
    22902311                                           QSizePolicy::Preferred, QSizePolicy::Fixed);
    22912312    }
     2313#else // !Q_WS_MAC
     2314    NOREF (aTargetRect);
     2315#endif // !Q_WS_MAC
    22922316}
    22932317
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