VirtualBox

Changeset 52303 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Aug 6, 2014 5:19:03 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: Mac OS X: Runtime UI: Native full-screen support: Subsequent cumulative native full-screen validation fix.

File:
1 edited

Legend:

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

    r52300 r52303  
    2929#include "UIMultiScreenLayout.h"
    3030#include "UIShortcutPool.h"
     31#include "UIMachineView.h"
    3132#include "QIMenu.h"
    3233#ifdef Q_WS_MAC
     
    145146    m_fullscreenMachineWindows.insert(pMachineWindow);
    146147    AssertReturnVoid(m_fullscreenMachineWindows.contains(pMachineWindow));
     148
     149    /* Revalidate native fullscreen: */
     150    revalidateNativeFullScreen();
    147151}
    148152
     
    186190                (int)pMachineWindow->screenId()));
    187191
    188         /* Exclude window from invalidation list: */
     192        /* Exclude machine-window from invalidation set: */
    189193        m_invalidFullscreenMachineWindows.remove(pMachineWindow);
    190 
    191         /* Revalidate 'fullscreen' window: */
    192         revalidateNativeFullScreen(pMachineWindow);
     194        AssertReturnVoid(!m_invalidFullscreenMachineWindows.contains(pMachineWindow));
     195
     196        /* Revalidate native fullscreen: */
     197        revalidateNativeFullScreen();
    193198    }
    194199    /* If there are no invalidated windows: */
     
    383388        setPresentationModeEnabled(true);
    384389    }
    385     /* Revalidate 'fullscreen' windows for ML and next: */
     390    /* Revalidate native fullscreen for ML and next: */
    386391    else revalidateNativeFullScreen();
    387392#else /* !Q_WS_MAC */
     
    405410    if (vboxGlobal().osRelease() <= MacOSXRelease_Lion)
    406411        UIMachineLogic::sltGuestMonitorChange(changeType, uScreenId, screenGeo);
    407     /* Revalidate 'fullscreen' windows for ML and next: */
     412    /* Revalidate native fullscreen for ML and next: */
    408413    else revalidateNativeFullScreen();
    409414#else /* !Q_WS_MAC */
     
    424429    if (vboxGlobal().osRelease() <= MacOSXRelease_Lion)
    425430        UIMachineLogic::sltHostScreenCountChange();
    426     /* Revalidate 'fullscreen' windows for ML and next: */
     431    /* Revalidate native fullscreen for ML and next: */
    427432    else revalidateNativeFullScreen();
    428433#else /* !Q_WS_MAC */
     
    545550                    Qt::QueuedConnection);
    546551        }
    547         /* Revalidate 'fullscreen' windows: */
     552        /* Revalidate native fullscreen: */
    548553        revalidateNativeFullScreen();
    549554    }
     
    675680    if (uScreenID != 0 && !screensHaveSeparateSpaces())
    676681    {
    677         LogRel(("UIMachineLogicFullscreen::revalidateNativeFullScreen: "
    678                 "Ask machine-window #%d to show/normalize.\n", (int)uScreenID));
    679 
    680         /* Make sure window have proper geometry: */
    681         pMachineWindow->showInNecessaryMode();
     682        /* If there is no fullscreen window or it's invalidated: */
     683        if (m_fullscreenMachineWindows.isEmpty() || !m_invalidFullscreenMachineWindows.isEmpty())
     684        {
     685            LogRel(("UIMachineLogicFullscreen::revalidateNativeFullScreen: "
     686                    "Ask transient machine-window #%d to hide.\n", (int)uScreenID));
     687
     688            pMachineWindow->hide();
     689        }
     690        /* If there is valid fullscreen window: */
     691        else
     692        {
     693            LogRel(("UIMachineLogicFullscreen::revalidateNativeFullScreen: "
     694                    "Ask transient machine-window #%d to show/normalize.\n", (int)uScreenID));
     695
     696            /* Make sure window have proper geometry and shown: */
     697            pMachineWindow->showInNecessaryMode();
     698        }
    682699    }
    683700    /* Validate window which can be fullscreen: */
     
    712729                        "Ask machine-window #%d to hide.\n", (int)uScreenID));
    713730
    714                 /* Else make sure that window is hidden: */
    715                 pMachineWindow->showInNecessaryMode();
     731                pMachineWindow->hide();
    716732            }
    717733        }
     
    728744             * 1. shouldn't really be shown or
    729745             * 2. isn't mapped to some host-screen or
    730              * 3. should be located on another host-screen than currently or
    731              * 4. have another frame-buffer size than actually should. */
     746             * 3. should be located on another host-screen than currently. */
    732747            if (   !uisession()->isScreenVisible(uScreenID)
    733748                || !hasHostScreenForGuestScreen(uScreenID)
    734                 || iWantedHostScreenIndex != iCurrentHostScreenIndex
    735                 || frameBufferSize != screenSize)
     749                || iWantedHostScreenIndex != iCurrentHostScreenIndex)
    736750            {
    737751                LogRel(("UIMachineLogicFullscreen::revalidateNativeFullScreen: "
     
    744758                emit sigNotifyAboutNativeFullscreenShouldBeExited(pMachineWindow);
    745759            }
     760
     761            /* If that window
     762             * 1. have another frame-buffer size than actually should. */
     763            else if (frameBufferSize != screenSize)
     764            {
     765                LogRel(("UIMachineLogicFullscreen::revalidateNativeFullScreen: "
     766                        "Ask machine-window #%d to adjust guest geometry.\n", (int)uScreenID));
     767
     768                /* Adjust guest screen size if necessary: */
     769                pMachineWindow->machineView()->maybeAdjustGuestScreenSize();
     770            }
    746771        }
    747772    }
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