VirtualBox

Ignore:
Timestamp:
Jun 10, 2014 11:52:29 AM (11 years ago)
Author:
vboxsync
Message:

FE/Qt: 6660: Advanced extra-data management framework: Forgot something in r94198.

File:
1 edited

Legend:

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

    r51569 r51587  
    7979     * We have to make sure they are valid, which means there have to be unique combinations
    8080     * and all guests screens need there own host screen. */
    81     CMachine machine = m_pMachineLogic->session().GetMachine();
    8281    CDisplay display = m_pMachineLogic->session().GetConsole().GetDisplay();
    8382    bool fShouldWeAutoMountGuestScreens = gEDataManager->shouldWeAutoMountGuestScreens(vboxGlobal().managedVMUuid());
     
    102101        {
    103102            /* Check the position of the guest window in normal mode.
    104              * This makes sure that on first use the window opens on the same screen as the normal window was before.
    105              * This even works with multi-screen. The user just have to move all the normal windows to the target screens
    106              * and they will magically open there in seamless/fullscreen also. */
    107             QString strTest1 = machine.GetExtraData(GUI_LastNormalWindowPosition + (iGuestScreen > 0 ? QString::number(iGuestScreen): ""));
    108             QRegExp posParser("(-?\\d+),(-?\\d+),(-?\\d+),(-?\\d+)");
    109             if (posParser.exactMatch(strTest1))
     103             * This makes sure that on first use fullscreen/seamless window opens on the same host-screen as the normal window was before.
     104             * This even works with multi-screen. The user just have to move all the normal windows to the target host-screens
     105             * and they will magically open there in fullscreen/seamless also. */
     106            QRect geo = gEDataManager->machineWindowGeometry(m_pMachineLogic->visualStateType(), iGuestScreen, vboxGlobal().managedVMUuid());
     107            /* If geometry is valid: */
     108            if (!geo.isNull())
    110109            {
    111                 /* If parsing was successfully, convert it to a position: */
    112                 bool fOk1, fOk2;
    113                 QPoint p(posParser.cap(1).toInt(&fOk1), posParser.cap(2).toInt(&fOk2));
    114                 /* Check to which screen the position belongs: */
    115                 iHostScreen = pDW->screenNumber(p);
     110                /* Get top-left corner position: */
     111                QPoint topLeftPosition(geo.topLeft());
     112                /* Check which host-screen the position belongs to: */
     113                iHostScreen = pDW->screenNumber(topLeftPosition);
    116114                /* Revalidate: */
    117                 fValid =    fOk1 && fOk2 /* Valid data */
    118                          && iHostScreen >= 0 && iHostScreen < m_cHostScreens /* In the host screen bounds? */
     115                fValid =    iHostScreen >= 0 && iHostScreen < m_cHostScreens /* In the host screen bounds? */
    119116                         && m_screenMap.key(iHostScreen, -1) == -1; /* Not taken already? */
    120117            }
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