VirtualBox

Ignore:
Timestamp:
May 22, 2008 9:39:26 AM (17 years ago)
Author:
vboxsync
Message:

FE/Qt-OSX: Fix for r31128 which broke seamless mode on Mac OS X.

File:
1 edited

Legend:

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

    r9043 r9050  
    19421942bool VBoxConsoleWnd::toggleFullscreenMode (bool aOn, bool aSeamless)
    19431943{
     1944    /* Please note: For some platforms like the Mac, the calling order of the
     1945     * functions in this methods is vital. So please be carefull on changing
     1946     * this. */
     1947
    19441948    QSize initialSize = size();
    19451949    if (aSeamless || console->isAutoresizeGuestActive())
     
    21162120        console->setVScrollBarMode (QScrollView::AlwaysOff);
    21172121        console->setHScrollBarMode (QScrollView::AlwaysOff);
    2118 
    2119 #ifdef Q_WS_MAC /* setMask seems to not include the far border pixels. */
    2120 //        QRect maskRect = dtw->screenGeometry (this);
    2121 //        maskRect.setRight (maskRect.right() + 1);
    2122 //        maskRect.setBottom (maskRect.bottom() + 1);
    2123 //        setMask (maskRect);
    2124         if (aSeamless)
    2125         {
    2126             OSStatus status;
    2127             WindowPtr WindowRef = reinterpret_cast<WindowPtr>(winId());
    2128             EventTypeSpec wNonCompositingEvent = { kEventClassWindow, kEventWindowGetRegion };
    2129             status = InstallWindowEventHandler (WindowRef, DarwinRegionHandler, GetEventTypeCount (wNonCompositingEvent), &wNonCompositingEvent, &mCurrRegion, &mDarwinRegionEventHandlerRef);
    2130             Assert (status == noErr);
    2131             status = ReshapeCustomWindow (WindowRef);
    2132             Assert (status == noErr);
    2133             UInt32 features;
    2134             status = GetWindowFeatures (WindowRef, &features);
    2135             Assert (status == noErr);
    2136             if (( features & kWindowIsOpaque ) != 0)
    2137             {
    2138                 status = HIWindowChangeFeatures (WindowRef, 0, kWindowIsOpaque);
    2139                 Assert(status == noErr);
    2140             }
    2141             status = SetWindowAlpha(WindowRef, 0.999);
    2142             Assert (status == noErr);
    2143             /* For now disable the shadow of the window. This feature cause errors
    2144              * if a window in vbox looses focus, is reselected and than moved. */
    2145             /** @todo Search for an option to enable this again. A shadow on every
    2146              * window has a big coolness factor. */
    2147             ChangeWindowAttributes (WindowRef, kWindowNoShadowAttribute, 0);
    2148         }
    2149 #else
    2150 //        setMask (dtw->screenGeometry (this));
    2151 #endif
    21522122    }
    21532123    else
     
    21702140        if (aSeamless)
    21712141        {
     2142            /* Please note: All the stuff below has to be done before the
     2143             * window switch back to normal size. Qt changes the winId on the
     2144             * fullscreen switch and make this stuff useless with the old
     2145             * winId. So please be carefull on rearrangement of the method
     2146             * calls. */
    21722147            /* Undo all mac specific installations */
    21732148            OSStatus status;
     
    22042179    /* Toggle qt full-screen mode */
    22052180    setWindowState (windowState() ^ WindowFullScreen);
     2181
     2182#ifdef Q_WS_MAC
     2183    if (aOn && aSeamless)
     2184    {
     2185        /* Please note: All the stuff below has to be done after the window has
     2186         * switched to fullscreen. Qt changes the winId on the fullscreen
     2187         * switch and make this stuff useless with the old winId. So please be
     2188         * carefull on rearrangement of the method calls. */
     2189        OSStatus status;
     2190        WindowPtr WindowRef = reinterpret_cast<WindowPtr>(winId());
     2191        EventTypeSpec wNonCompositingEvent = { kEventClassWindow, kEventWindowGetRegion };
     2192        status = InstallWindowEventHandler (WindowRef, DarwinRegionHandler, GetEventTypeCount (wNonCompositingEvent), &wNonCompositingEvent, &mCurrRegion, &mDarwinRegionEventHandlerRef);
     2193        Assert (status == noErr);
     2194        status = ReshapeCustomWindow (WindowRef);
     2195        Assert (status == noErr);
     2196        UInt32 features;
     2197        status = GetWindowFeatures (WindowRef, &features);
     2198        Assert (status == noErr);
     2199        if (( features & kWindowIsOpaque ) != 0)
     2200        {
     2201            status = HIWindowChangeFeatures (WindowRef, 0, kWindowIsOpaque);
     2202            Assert(status == noErr);
     2203        }
     2204        status = SetWindowAlpha(WindowRef, 0.999);
     2205        Assert (status == noErr);
     2206        /* For now disable the shadow of the window. This feature cause errors
     2207         * if a window in vbox looses focus, is reselected and than moved. */
     2208        /** @todo Search for an option to enable this again. A shadow on every
     2209         * window has a big coolness factor. */
     2210        ChangeWindowAttributes (WindowRef, kWindowNoShadowAttribute, 0);
     2211    }
     2212#endif
    22062213
    22072214    /* Process all console attributes changes and sub-widget hidings */
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