VirtualBox

Ignore:
Timestamp:
Jun 17, 2016 2:32:26 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
108135
Message:

FE/Qt: bugref:8422: Runtime UI: Full-screen window: X11 multi-screen adjustments according to Qt5 requirements.

File:
1 edited

Legend:

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

    r61726 r61748  
    319319void UIMachineWindowFullscreen::placeOnScreen()
    320320{
     321    /* Make sure this window has fullscreen logic: */
     322    UIMachineLogicFullscreen *pFullscreenLogic = qobject_cast<UIMachineLogicFullscreen*>(machineLogic());
     323    AssertPtrReturnVoid(pFullscreenLogic);
     324
    321325    /* Get corresponding host-screen: */
    322     const int iHostScreen = qobject_cast<UIMachineLogicFullscreen*>(machineLogic())->hostScreenForGuestScreen(m_uScreenId);
     326    const int iHostScreen = pFullscreenLogic->hostScreenForGuestScreen(m_uScreenId);
    323327    /* And corresponding working area: */
    324328    const QRect workingArea = vboxGlobal().screenGeometry(iHostScreen);
     
    326330
    327331#if defined(VBOX_WS_MAC)
    328 
    329     /* Make sure this window has fullscreen logic: */
    330     UIMachineLogicFullscreen *pFullscreenLogic = qobject_cast<UIMachineLogicFullscreen*>(machineLogic());
    331     AssertPtrReturnVoid(pFullscreenLogic);
    332332
    333333    /* Move window to the appropriate position: */
     
    388388#elif defined(VBOX_WS_X11)
    389389
     390    /* Determine whether we should use the native full-screen mode: */
     391    const bool fUseNativeFullScreen = VBoxGlobal::supportsFullScreenMonitorsProtocolX11() &&
     392                                      !gEDataManager->legacyFullscreenModeRequested();
     393    if (fUseNativeFullScreen)
     394    {
     395        /* Tell recent window managers which host-screen this window should be mapped to: */
     396        VBoxGlobal::setFullScreenMonitorX11(this, pFullscreenLogic->hostScreenForGuestScreen(m_uScreenId));
     397
     398        /* If there is a mini-toolbar: */
     399        if (m_pMiniToolBar)
     400        {
     401            /* Tell recent window managers which host-screen this mini-toolbar should be mapped to: */
     402            VBoxGlobal::setFullScreenMonitorX11(m_pMiniToolBar, pFullscreenLogic->hostScreenForGuestScreen(m_uScreenId));
     403        }
     404    }
     405
    390406    /* Set appropriate geometry for window: */
    391407    resize(workingArea.size());
     
    526542            return;
    527543
    528         /* If WM doesn't support native stuff, we need to call for placeOnScreen(): */
    529         const bool fUseNativeFullScreen = VBoxGlobal::supportsFullScreenMonitorsProtocolX11() &&
    530                                           !gEDataManager->legacyFullscreenModeRequested();
    531         if (!fUseNativeFullScreen)
    532         {
    533             /* Make sure window have appropriate geometry: */
    534             placeOnScreen();
    535         }
    536 
    537544        /* Show window: */
    538545        showFullScreen();
     
    545552        }
    546553
     554        /* Make sure window have appropriate geometry: */
     555        placeOnScreen();
     556
    547557        /* Restore minimized state if necessary: */
    548558        if (m_fWasMinimized)
     
    550560            m_fWasMinimized = false;
    551561            showMinimized();
    552         }
    553 
    554         /* If WM supports native stuff, we need to map window to corresponding host-screen. */
    555         if (fUseNativeFullScreen)
    556         {
    557             /* Tell recent window managers which host-screen this window should be mapped to: */
    558             VBoxGlobal::setFullScreenMonitorX11(this, pFullscreenLogic->hostScreenForGuestScreen(m_uScreenId));
    559 
    560             /* If there is a mini-toolbar: */
    561             if (m_pMiniToolBar)
    562             {
    563                 /* Tell recent window managers which host-screen this mini-toolbar should be mapped to: */
    564                 VBoxGlobal::setFullScreenMonitorX11(m_pMiniToolBar, pFullscreenLogic->hostScreenForGuestScreen(m_uScreenId));
    565             }
    566562        }
    567563
Note: See TracChangeset for help on using the changeset viewer.

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