VirtualBox

儲存庫 vbox 的更動 63054


忽略:
時間撮記:
2016-8-5 下午03:37:38 (8 年 以前)
作者:
vboxsync
訊息:

FE/Qt: bugref:8422: Desktop-widget watchdog rework (part 12): Moving desktop related stuff to desktop-widget watchdog rails; removing similar stuff from VBoxGlobal.

位置:
trunk/src/VBox/Frontends/VirtualBox/src
檔案:
修改 23 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Frontends/VirtualBox/src/UIVMLogViewer.cpp

    r62493 r63054  
    4242# include "UISpecialControls.h"
    4343# include "UIVMLogViewer.h"
     44# include "UIDesktopWidgetWatchdog.h"
    4445# include "VBoxGlobal.h"
    4546# include "VBoxUtils.h"
     
    10131014    {
    10141015        /* Getting available geometry to calculate default geometry: */
    1015         const QRect desktopRect = vboxGlobal().availableGeometry(this);
     1016        const QRect desktopRect = gpDesktop->availableGeometry(this);
    10161017        int iDefaultWidth = desktopRect.width() / 2;
    10171018        int iDefaultHeight = desktopRect.height() * 3 / 4;
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIArrowSplitter.cpp

    r62493 r63054  
    3030# include "QIArrowButtonSwitch.h"
    3131# include "QIArrowButtonPress.h"
     32# include "UIDesktopWidgetWatchdog.h"
    3233# include "UIIconPool.h"
    33 # include "VBoxGlobal.h"
    3434
    3535/* Other VBox includes: */
     
    8383
    8484    /* Get 40% of the screen-area to limit the resulting hint: */
    85     const QSize screenGeometryDot4 = vboxGlobal().screenGeometry(this).size() * .4;
     85    const QSize screenGeometryDot4 = gpDesktop->screenGeometry(this).size() * .4;
    8686
    8787    /* Calculate minimum size-hint which is document-size limited by screen-area: */
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r62493 r63054  
    3939
    4040/* GUI includes: */
     41# include "UIDesktopWidgetWatchdog.h"
    4142# include "UIExtraDataManager.h"
    4243# include "UIMainEventListener.h"
     
    24282429
    24292430    /* Get available-geometry [of screen with point (iX, iY) if possible]: */
    2430     const QRect availableGeometry = fOk ? vboxGlobal().availableGeometry(QPoint(iX, iY)) :
    2431                                           vboxGlobal().availableGeometry();
     2431    const QRect availableGeometry = fOk ? gpDesktop->availableGeometry(QPoint(iX, iY)) :
     2432                                          gpDesktop->availableGeometry();
    24322433
    24332434    /* In Windows Qt fails to reposition out of screen window properly, so doing it ourselves: */
     
    36403641
    36413642    /* Get available-geometry [of screen with point (iX, iY) if possible]: */
    3642     const QRect availableGeometry = fOk ? vboxGlobal().availableGeometry(QPoint(iX, iY)) :
    3643                                           vboxGlobal().availableGeometry();
     3643    const QRect availableGeometry = fOk ? gpDesktop->availableGeometry(QPoint(iX, iY)) :
     3644                                          gpDesktop->availableGeometry();
    36443645
    36453646    /* In Windows Qt fails to reposition out of screen window properly, so doing it ourselves: */
     
    37993800
    38003801    /* Get available-geometry [of screen with point (iX, iY) if possible]: */
    3801     const QRect availableGeometry = fOk ? vboxGlobal().availableGeometry(QPoint(iX, iY)) :
    3802                                           vboxGlobal().availableGeometry();
     3802    const QRect availableGeometry = fOk ? gpDesktop->availableGeometry(QPoint(iX, iY)) :
     3803                                          gpDesktop->availableGeometry();
    38033804
    38043805    /* In Windows Qt fails to reposition out of screen window properly, so doing it ourselves: */
     
    39183919#ifdef VBOX_WS_WIN
    39193920    /* Get available-geometry [of screen with point (iX, iY) if possible]: */
    3920     const QRect availableGeometry = fOk ? vboxGlobal().availableGeometry(QPoint(iX, iY)) :
    3921                                           vboxGlobal().availableGeometry();
     3921    const QRect availableGeometry = fOk ? gpDesktop->availableGeometry(QPoint(iX, iY)) :
     3922                                          gpDesktop->availableGeometry();
    39223923
    39233924    /* Make sure resulting geometry is within current bounds: */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r63044 r63054  
    339339#endif /* VBOX_WS_MAC */
    340340
    341 int VBoxGlobal::screenCount() const
    342 {
    343     /* Redirect call to QDesktopWidget: */
    344     return QApplication::desktop()->screenCount();
    345 }
    346 
    347 int VBoxGlobal::screenNumber(const QWidget *pWidget) const
    348 {
    349     /* Redirect call to QDesktopWidget: */
    350     return QApplication::desktop()->screenNumber(pWidget);
    351 }
    352 
    353 int VBoxGlobal::screenNumber(const QPoint &point) const
    354 {
    355     /* Redirect call to QDesktopWidget: */
    356     return QApplication::desktop()->screenNumber(point);
    357 }
    358 
    359 const QRect VBoxGlobal::screenGeometry(int iHostScreenIndex /* = -1 */) const
    360 {
    361 #ifdef VBOX_WS_X11
    362     /* Make sure desktop-widget watchdog already created: */
    363     AssertPtrReturn(gpDesktop, QApplication::desktop()->screenGeometry(iHostScreenIndex));
    364     /* Redirect call to UIDesktopWidgetWatchdog: */
    365     return gpDesktop->screenGeometry(iHostScreenIndex);
    366 #endif /* VBOX_WS_X11 */
    367 
    368     /* Redirect call to QDesktopWidget: */
    369     return QApplication::desktop()->screenGeometry(iHostScreenIndex);
    370 }
    371 
    372 const QRect VBoxGlobal::availableGeometry(int iHostScreenIndex /* = -1 */) const
    373 {
    374 #ifdef VBOX_WS_X11
    375     /* Make sure desktop-widget watchdog already created: */
    376     AssertPtrReturn(gpDesktop, QApplication::desktop()->availableGeometry(iHostScreenIndex));
    377     /* Redirect call to UIDesktopWidgetWatchdog: */
    378     return gpDesktop->availableGeometry(iHostScreenIndex);
    379 #endif /* VBOX_WS_X11 */
    380 
    381     /* Redirect call to QDesktopWidget: */
    382     return QApplication::desktop()->availableGeometry(iHostScreenIndex);
    383 }
    384 
    385 const QRect VBoxGlobal::screenGeometry(const QWidget *pWidget) const
    386 {
    387     /* Redirect call to existing wrapper: */
    388     return screenGeometry(screenNumber(pWidget));
    389 }
    390 
    391 const QRect VBoxGlobal::availableGeometry(const QWidget *pWidget) const
    392 {
    393     /* Redirect call to existing wrapper: */
    394     return availableGeometry(screenNumber(pWidget));
    395 }
    396 
    397 const QRect VBoxGlobal::screenGeometry(const QPoint &point) const
    398 {
    399     /* Redirect call to existing wrapper: */
    400     return screenGeometry(screenNumber(point));
    401 }
    402 
    403 const QRect VBoxGlobal::availableGeometry(const QPoint &point) const
    404 {
    405     /* Redirect call to existing wrapper: */
    406     return availableGeometry(screenNumber(point));
    407 }
    408 
    409 #if defined(VBOX_WS_X11) && QT_VERSION >= 0x050000
    410 bool VBoxGlobal::isFakeScreenDetected() const
    411 {
    412     // WORKAROUND:
    413     // In 5.6.1 Qt devs taught the XCB plugin to silently swap last detached screen
    414     // with a fake one, and there is no API-way to distinguish fake from real one
    415     // because all they do is erasing output for the last real screen, keeping
    416     // all other screen attributes stale. Gladly output influencing screen name
    417     // so we can use that horrible workaround to detect a fake XCB screen.
    418     return    qApp->screens().size() == 0 /* zero-screen case is impossible after 5.6.1 */
    419            || (qApp->screens().size() == 1 && qApp->screens().first()->name() == ":0.0");
    420 }
    421 #endif /* VBOX_WS_X11 && QT_VERSION >= 0x050000 */
    422 
    423341/**
    424342 *  Sets the new global settings and saves them to the VirtualBox server.
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r63044 r63054  
    142142    /** Returns the thread-pool instance. */
    143143    UIThreadPool* threadPool() const { return m_pThreadPool; }
    144 
    145     /** @name Host-screen geometry stuff
    146       * @{ */
    147         /** Returns the number of host-screens currently available on the system. */
    148         int screenCount() const;
    149 
    150         /** Returns the index of the screen which contains contains @a pWidget. */
    151         int screenNumber(const QWidget *pWidget) const;
    152         /** Returns the index of the screen which contains contains @a point. */
    153         int screenNumber(const QPoint &point) const;
    154 
    155         /** Returns the geometry of the host-screen with @a iHostScreenIndex.
    156           * @note The default screen is used if @a iHostScreenIndex is -1. */
    157         const QRect screenGeometry(int iHostScreenIndex = -1) const;
    158         /** Returns the available-geometry of the host-screen with @a iHostScreenIndex.
    159           * @note The default screen is used if @a iHostScreenIndex is -1. */
    160         const QRect availableGeometry(int iHostScreenIndex = -1) const;
    161 
    162         /** Returns the geometry of the host-screen which contains @a pWidget. */
    163         const QRect screenGeometry(const QWidget *pWidget) const;
    164         /** Returns the available-geometry of the host-screen which contains @a pWidget. */
    165         const QRect availableGeometry(const QWidget *pWidget) const;
    166 
    167         /** Returns the geometry of the host-screen which contains @a point. */
    168         const QRect screenGeometry(const QPoint &point) const;
    169         /** Returns the available-geometry of the host-screen which contains @a point. */
    170         const QRect availableGeometry(const QPoint &point) const;
    171 
    172 #if defined(VBOX_WS_X11) && QT_VERSION >= 0x050000
    173         /** Qt5: X11: Returns whether no or fake screen detected. */
    174         bool isFakeScreenDetected() const;
    175 #endif /* VBOX_WS_X11 && QT_VERSION >= 0x050000 */
    176     /** @} */
    177144
    178145    VBoxGlobalSettings &settings() { return gset; }
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r62493 r63054  
    2929/* GUI includes: */
    3030# include "VBoxGlobal.h"
     31# include "UIDesktopWidgetWatchdog.h"
    3132# include "UIExtraDataManager.h"
    3233# include "UIMessageCenter.h"
     
    14371438            {
    14381439                /* Get current host-screen number: */
    1439                 const int iCurrentHostScreenNumber = vboxGlobal().screenNumber(this);
     1440                const int iCurrentHostScreenNumber = gpDesktop->screenNumber(this);
    14401441                if (m_iHostScreenNumber != iCurrentHostScreenNumber)
    14411442                {
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp

    r62493 r63054  
    2727/* GUI includes: */
    2828# include "VBoxGlobal.h"
     29# include "UIDesktopWidgetWatchdog.h"
    2930# include "UIExtraDataManager.h"
    3031# include "UIMessageCenter.h"
     
    184185        QPoint visibleRectanglePos = m_views[m_iMouseCaptureViewIndex]->mapToGlobal(m_viewports[m_iMouseCaptureViewIndex]->pos());
    185186        visibleRectangle.translate(visibleRectanglePos);
    186         visibleRectangle = visibleRectangle.intersected(vboxGlobal().availableGeometry(machineLogic()->machineWindows()[m_iMouseCaptureViewIndex]));
     187        visibleRectangle = visibleRectangle.intersected(gpDesktop->availableGeometry(machineLogic()->machineWindows()[m_iMouseCaptureViewIndex]));
    187188
    188189#ifdef VBOX_WS_WIN
     
    11191120        viewportRectangle.translate(viewportRectangleGlobalPos);
    11201121        /* Trim full-viewport-rectangle by available geometry: */
    1121         viewportRectangle = viewportRectangle.intersected(vboxGlobal().availableGeometry(machineLogic()->machineWindows()[m_iMouseCaptureViewIndex]));
     1122        viewportRectangle = viewportRectangle.intersected(gpDesktop->availableGeometry(machineLogic()->machineWindows()[m_iMouseCaptureViewIndex]));
    11221123        /* Trim partial-viewport-rectangle by top-most windows: */
    11231124        QRegion viewportRegion(viewportRectangle);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp

    r62493 r63054  
    3333# include "UIMessageCenter.h"
    3434# include "UIExtraDataManager.h"
     35# include "UIDesktopWidgetWatchdog.h"
    3536# include "VBoxGlobal.h"
    3637
     
    99100                QPoint topLeftPosition(geo.topLeft());
    100101                /* Check which host-screen the position belongs to: */
    101                 iHostScreen = vboxGlobal().screenNumber(topLeftPosition);
     102                iHostScreen = gpDesktop->screenNumber(topLeftPosition);
    102103                /* Revalidate: */
    103104                fValid =    iHostScreen >= 0 && iHostScreen < m_cHostScreens /* In the host screen bounds? */
     
    257258void UIMultiScreenLayout::calculateHostMonitorCount()
    258259{
    259     m_cHostScreens = vboxGlobal().screenCount();
     260    m_cHostScreens = gpDesktop->screenCount();
    260261}
    261262
     
    296297        QRect screen;
    297298        if (m_pMachineLogic->visualStateType() == UIVisualStateType_Seamless)
    298             screen = vboxGlobal().availableGeometry(screenLayout.value(iGuestScreen, 0));
     299            screen = gpDesktop->availableGeometry(screenLayout.value(iGuestScreen, 0));
    299300        else
    300             screen = vboxGlobal().screenGeometry(screenLayout.value(iGuestScreen, 0));
     301            screen = gpDesktop->screenGeometry(screenLayout.value(iGuestScreen, 0));
    301302        KGuestMonitorStatus monitorStatus = KGuestMonitorStatus_Enabled;
    302303        display.GetScreenResolution(iGuestScreen, width, height, guestBpp, xOrigin, yOrigin, monitorStatus);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r62588 r63054  
    3131/* GUI includes: */
    3232# include "VBoxGlobal.h"
     33# include "UIDesktopWidgetWatchdog.h"
    3334# include "UIExtraDataManager.h"
    3435# include "UISession.h"
     
    841842
    842843    /* Check if display count changed: */
    843     if (vboxGlobal().screenCount() != m_hostScreens.size())
     844    if (gpDesktop->screenCount() != m_hostScreens.size())
    844845    {
    845846        /* Reset watchdog: */
     
    851852    {
    852853        /* Check if at least one display geometry changed: */
    853         for (int iScreenIndex = 0; iScreenIndex < vboxGlobal().screenCount(); ++iScreenIndex)
    854         {
    855             if (vboxGlobal().screenGeometry(iScreenIndex) != m_hostScreens.at(iScreenIndex))
     854        for (int iScreenIndex = 0; iScreenIndex < gpDesktop->screenCount(); ++iScreenIndex)
     855        {
     856            if (gpDesktop->screenGeometry(iScreenIndex) != m_hostScreens.at(iScreenIndex))
    856857            {
    857858                /* Reset watchdog: */
     
    21972198{
    21982199    m_hostScreens.clear();
    2199     for (int iScreenIndex = 0; iScreenIndex < vboxGlobal().screenCount(); ++iScreenIndex)
    2200         m_hostScreens << vboxGlobal().screenGeometry(iScreenIndex);
     2200    for (int iScreenIndex = 0; iScreenIndex < gpDesktop->screenCount(); ++iScreenIndex)
     2201        m_hostScreens << gpDesktop->screenGeometry(iScreenIndex);
    22012202}
    22022203
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp

    r62493 r63054  
    2525/* GUI includes: */
    2626# include "VBoxGlobal.h"
     27# include "UIDesktopWidgetWatchdog.h"
    2728# include "UIMessageCenter.h"
    2829# include "UISession.h"
     
    766767            /* Variables to compare: */
    767768            const int iWantedHostScreenIndex = hostScreenForGuestScreen((int)uScreenID);
    768             const int iCurrentHostScreenIndex = vboxGlobal().screenNumber(pMachineWindow);
     769            const int iCurrentHostScreenIndex = gpDesktop->screenNumber(pMachineWindow);
    769770            const QSize frameBufferSize((int)uisession()->frameBuffer(uScreenID)->width(), (int)uisession()->frameBuffer(uScreenID)->height());
    770             const QSize screenSize = vboxGlobal().screenGeometry(iWantedHostScreenIndex).size();
     771            const QSize screenSize = gpDesktop->screenGeometry(iWantedHostScreenIndex).size();
    771772
    772773            /* If that window
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp

    r62493 r63054  
    2929
    3030/* GUI includes: */
    31 # include "VBoxGlobal.h"
    3231# include "UISession.h"
    3332# include "UIActionPoolRuntime.h"
     
    3736# include "UIFrameBuffer.h"
    3837# include "UIExtraDataManager.h"
     38# include "UIDesktopWidgetWatchdog.h"
     39
     40/* Other VBox includes: */
     41# include "VBox/log.h"
    3942
    4043#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
     
    212215    int iScreen = static_cast<UIMachineLogicFullscreen*>(machineLogic())->hostScreenForGuestScreen(screenId());
    213216    /* Return available geometry for that screen: */
    214     return vboxGlobal().screenGeometry(iScreen);
     217    return gpDesktop->screenGeometry(iScreen);
    215218}
    216219
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp

    r62493 r63054  
    3131/* GUI includes: */
    3232# include "VBoxGlobal.h"
     33# include "UIDesktopWidgetWatchdog.h"
    3334# include "UIExtraDataManager.h"
    3435# include "UISession.h"
     
    321322    const int iHostScreen = pFullscreenLogic->hostScreenForGuestScreen(m_uScreenId);
    322323    /* And corresponding working area: */
    323     const QRect workingArea = vboxGlobal().screenGeometry(iHostScreen);
     324    const QRect workingArea = gpDesktop->screenGeometry(iHostScreen);
    324325    Q_UNUSED(workingArea);
    325326
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp

    r62917 r63054  
    2727/* GUI includes: */
    2828# include "VBoxGlobal.h"
     29# include "UIDesktopWidgetWatchdog.h"
    2930# include "UIMessageCenter.h"
    3031# include "UISession.h"
     
    255256#if defined(VBOX_WS_X11) && QT_VERSION >= 0x050000
    256257    /* Prevent handling if fake screen detected: */
    257     if (vboxGlobal().isFakeScreenDetected())
     258    if (gpDesktop->isFakeScreenDetected())
    258259        return;
    259260
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp

    r62493 r63054  
    2828
    2929/* GUI includes: */
    30 # include "VBoxGlobal.h"
    3130# include "UISession.h"
    3231# include "UIActionPoolRuntime.h"
     
    3433# include "UIMachineWindow.h"
    3534# include "UIMachineViewNormal.h"
     35# include "UIFrameBuffer.h"
    3636# include "UIExtraDataManager.h"
    37 # include "UIFrameBuffer.h"
     37# include "UIDesktopWidgetWatchdog.h"
     38
     39/* Other VBox includes: */
     40# include "VBox/log.h"
    3841
    3942#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
     
    255258QRect UIMachineViewNormal::workingArea() const
    256259{
    257     return vboxGlobal().availableGeometry(this);
     260    return gpDesktop->availableGeometry(this);
    258261}
    259262
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r62917 r63054  
    2929/* GUI includes: */
    3030# include "VBoxGlobal.h"
     31# include "UIDesktopWidgetWatchdog.h"
    3132# include "UIMachineWindowNormal.h"
    3233# include "UIActionPoolRuntime.h"
     
    392393        {
    393394            /* Get available geometry, for screen with (x,y) coords if possible: */
    394             QRect availableGeo = !geo.isNull() ? vboxGlobal().availableGeometry(QPoint(geo.x(), geo.y())) :
    395                                                  vboxGlobal().availableGeometry(this);
     395            QRect availableGeo = !geo.isNull() ? gpDesktop->availableGeometry(QPoint(geo.x(), geo.y())) :
     396                                                 gpDesktop->availableGeometry(this);
    396397
    397398            /* Normalize to the optimal size: */
     
    464465#if defined(VBOX_WS_X11) && QT_VERSION >= 0x050000
    465466            /* Prevent handling if fake screen detected: */
    466             if (vboxGlobal().isFakeScreenDetected())
     467            if (gpDesktop->isFakeScreenDetected())
    467468                break;
    468469#endif /* VBOX_WS_X11 && QT_VERSION >= 0x050000 */
     
    484485#if defined(VBOX_WS_X11) && QT_VERSION >= 0x050000
    485486            /* Prevent handling if fake screen detected: */
    486             if (vboxGlobal().isFakeScreenDetected())
     487            if (gpDesktop->isFakeScreenDetected())
    487488                break;
    488489#endif /* VBOX_WS_X11 && QT_VERSION >= 0x050000 */
     
    571572    /* Calculate common bound region: */
    572573    QRegion region;
    573     for (int iScreenIndex = 0; iScreenIndex < vboxGlobal().screenCount(); ++iScreenIndex)
     574    for (int iScreenIndex = 0; iScreenIndex < gpDesktop->screenCount(); ++iScreenIndex)
    574575    {
    575576        /* Get enumerated screen's available area: */
    576         QRect rect = vboxGlobal().availableGeometry(iScreenIndex);
     577        QRect rect = gpDesktop->availableGeometry(iScreenIndex);
    577578#ifdef VBOX_WS_WIN
    578579        /* On Windows host window can exceed the available
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineLogicScale.cpp

    r62917 r63054  
    2727/* GUI includes: */
    2828# include "VBoxGlobal.h"
     29# include "UIDesktopWidgetWatchdog.h"
    2930# include "UIMessageCenter.h"
    3031# include "UISession.h"
     
    7980#if defined(VBOX_WS_X11) && QT_VERSION >= 0x050000
    8081    /* Prevent handling if fake screen detected: */
    81     if (vboxGlobal().isFakeScreenDetected())
     82    if (gpDesktop->isFakeScreenDetected())
    8283        return;
    8384
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp

    r62493 r63054  
    3030# include "UIMachineWindow.h"
    3131# include "UIMachineViewScale.h"
     32# include "UIFrameBuffer.h"
    3233# include "UIExtraDataManager.h"
    33 # include "UIFrameBuffer.h"
     34# include "UIDesktopWidgetWatchdog.h"
    3435
    3536/* COM includes: */
     
    3839
    3940/* Other VBox includes: */
    40 #include <VBox/VBoxOGL.h>
     41# include "VBox/log.h"
     42# include <VBox/VBoxOGL.h>
    4143
    4244#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
     
    168170QRect UIMachineViewScale::workingArea() const
    169171{
    170     return vboxGlobal().availableGeometry(this);
     172    return gpDesktop->availableGeometry(this);
    171173}
    172174
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.cpp

    r62917 r63054  
    2828/* GUI includes: */
    2929# include "VBoxGlobal.h"
     30# include "UIDesktopWidgetWatchdog.h"
    3031# include "UIExtraDataManager.h"
    3132# include "UISession.h"
     
    112113        {
    113114            /* Get available geometry, for screen with (x,y) coords if possible: */
    114             QRect availableGeo = !geo.isNull() ? vboxGlobal().availableGeometry(QPoint(geo.x(), geo.y())) :
    115                                                  vboxGlobal().availableGeometry(this);
     115            QRect availableGeo = !geo.isNull() ? gpDesktop->availableGeometry(QPoint(geo.x(), geo.y())) :
     116                                                 gpDesktop->availableGeometry(this);
    116117
    117118            /* Resize to default size: */
     
    182183#if defined(VBOX_WS_X11) && QT_VERSION >= 0x050000
    183184            /* Prevent handling if fake screen detected: */
    184             if (vboxGlobal().isFakeScreenDetected())
     185            if (gpDesktop->isFakeScreenDetected())
    185186                break;
    186187#endif /* VBOX_WS_X11 && QT_VERSION >= 0x050000 */
     
    201202#if defined(VBOX_WS_X11) && QT_VERSION >= 0x050000
    202203            /* Prevent handling if fake screen detected: */
    203             if (vboxGlobal().isFakeScreenDetected())
     204            if (gpDesktop->isFakeScreenDetected())
    204205                break;
    205206#endif /* VBOX_WS_X11 && QT_VERSION >= 0x050000 */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp

    r62493 r63054  
    2929
    3030/* GUI includes: */
    31 # include "VBoxGlobal.h"
    3231# include "UISession.h"
    3332# include "UIMachineLogicSeamless.h"
     
    3635# include "UIFrameBuffer.h"
    3736# include "UIExtraDataManager.h"
     37# include "UIDesktopWidgetWatchdog.h"
    3838
    3939/* COM includes: */
    4040# include "CConsole.h"
    4141# include "CDisplay.h"
     42
     43/* Other VBox includes: */
     44# include "VBox/log.h"
    4245
    4346#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
     
    217220    int iScreen = static_cast<UIMachineLogicSeamless*>(machineLogic())->hostScreenForGuestScreen(screenId());
    218221    /* Return available geometry for that screen: */
    219     return vboxGlobal().availableGeometry(iScreen);
     222    return gpDesktop->availableGeometry(iScreen);
    220223}
    221224
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp

    r62493 r63054  
    2626/* GUI includes: */
    2727# include "VBoxGlobal.h"
     28# include "UIDesktopWidgetWatchdog.h"
    2829# include "UIExtraDataManager.h"
    2930# include "UISession.h"
     
    174175    const int iHostScreen = qobject_cast<UIMachineLogicSeamless*>(machineLogic())->hostScreenForGuestScreen(m_uScreenId);
    175176    /* And corresponding working area: */
    176     const QRect workingArea = vboxGlobal().availableGeometry(iHostScreen);
     177    const QRect workingArea = gpDesktop->availableGeometry(iHostScreen);
    177178
    178179    /* Set appropriate geometry for window: */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r62929 r63054  
    6767# include "UIVMItem.h"
    6868# include "UIExtraDataManager.h"
     69# include "UIDesktopWidgetWatchdog.h"
    6970# include "VBoxGlobal.h"
    7071# ifdef VBOX_WS_MAC
     
    142143{
    143144    /* Prevent handling if fake screen detected: */
    144     if (vboxGlobal().isFakeScreenDetected())
     145    if (gpDesktop->isFakeScreenDetected())
    145146        return;
    146147
     
    10841085#if defined(VBOX_WS_X11) && QT_VERSION >= 0x050000
    10851086            /* Prevent handling if fake screen detected: */
    1086             if (vboxGlobal().isFakeScreenDetected())
     1087            if (gpDesktop->isFakeScreenDetected())
    10871088                break;
    10881089#endif /* VBOX_WS_X11 && QT_VERSION >= 0x050000 */
     
    10991100#if defined(VBOX_WS_X11) && QT_VERSION >= 0x050000
    11001101            /* Prevent handling if fake screen detected: */
    1101             if (vboxGlobal().isFakeScreenDetected())
     1102            if (gpDesktop->isFakeScreenDetected())
    11021103                break;
    11031104#endif /* VBOX_WS_X11 && QT_VERSION >= 0x050000 */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp

    r62493 r63054  
    2323# include "QIWidgetValidator.h"
    2424# include "UIMachineSettingsDisplay.h"
     25# include "UIDesktopWidgetWatchdog.h"
    2526# include "UIExtraDataManager.h"
    2627# include "UIConverter.h"
     
    763764    m_iMaxVRAM = sys.GetMaxGuestVRAM();
    764765    m_iMaxVRAMVisible = m_iMaxVRAM;
    765     const uint cHostScreens = vboxGlobal().screenCount();
     766    const uint cHostScreens = gpDesktop->screenCount();
    766767    m_pSliderVideoMemorySize->setMinimum(m_iMinVRAM);
    767768    m_pSliderVideoMemorySize->setMaximum(m_iMaxVRAMVisible);
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp

    r62493 r63054  
    4242# include "UIAnimationFramework.h"
    4343# include "UIIconPool.h"
     44# include "UIDesktopWidgetWatchdog.h"
    4445# include "VBoxGlobal.h"
    4546# ifdef VBOX_WS_X11
     
    642643    switch (m_geometryType)
    643644    {
    644         case GeometryType_Available: workingArea = vboxGlobal().availableGeometry(iHostScreen); break;
    645         case GeometryType_Full:      workingArea = vboxGlobal().screenGeometry(iHostScreen); break;
     645        case GeometryType_Available: workingArea = gpDesktop->availableGeometry(iHostScreen); break;
     646        case GeometryType_Full:      workingArea = gpDesktop->screenGeometry(iHostScreen); break;
    646647    }
    647648    Q_UNUSED(workingArea);
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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