Changeset 29076 in vbox for trunk/src/VBox
- Timestamp:
- May 5, 2010 1:03:29 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp
r29069 r29076 81 81 * they are valid, which means there have to be unique combinations and all 82 82 * guests screens need there own host screen. */ 83 QDesktopWidget *pDW = QApplication::desktop(); 83 84 for (int i = 0; i < m_cGuestScreens; ++i) 84 85 { 86 /* If the user ever selected a combination in the view menu, we have 87 * the following entry: */ 85 88 QString strTest = machine.GetExtraData(QString("%1%2").arg(VBoxDefs::GUI_VirtualScreenToHostScreen).arg(i)); 86 89 bool fOk; … … 90 93 && cScreen >= 0 && cScreen < m_cHostScreens /* In the host screen bounds? */ 91 94 && m_pScreenMap->key(cScreen, -1) == -1)) /* Not taken already? */ 92 /* If not, use one from the available screens */ 93 cScreen = availableScreens.first(); 95 { 96 /* If not, check the position of the guest window in normal mode. 97 * This makes sure that on first use the window opens on the same 98 * screen as the normal window was before. This even works with 99 * multi-screen. The user just have to move all the normal windows 100 * to the target screens and they will magically open there in 101 * seamless/fullscreen also. */ 102 QString strTest1 = machine.GetExtraData(VBoxDefs::GUI_LastWindowPosition + (i > 0 ? QString::number(i): "")); 103 QRegExp posParser("(-?\\d+),(-?\\d+),(-?\\d+),(-?\\d+)"); 104 if ( posParser.exactMatch(strTest1) 105 && posParser.captureCount() == 4) 106 { 107 /* If parsing was successfully, convert it to a position. */ 108 bool fOk1, fOk2; 109 QPoint p(posParser.cap(1).toInt(&fOk1), posParser.cap(2).toInt(&fOk2)); 110 /* Check to which screen the position belongs. */ 111 cScreen = pDW->screenNumber(p); 112 if (!( fOk1 /* Valid data */ 113 && fOk2 /* Valid data */ 114 && cScreen >= 0 && cScreen < m_cHostScreens /* In the host screen bounds? */ 115 && m_pScreenMap->key(cScreen, -1) == -1)) /* Not taken already? */ 116 /* If not, simply pick the next one of the still available 117 * host screens. */ 118 cScreen = availableScreens.first(); 119 } 120 else 121 /* If not, simply pick the next one of the still available host 122 * screens. */ 123 cScreen = availableScreens.first(); 124 } 94 125 m_pScreenMap->insert(i, cScreen); 95 /* Remove the current setscreen from the list of available screens. */126 /* Remove the just selected screen from the list of available screens. */ 96 127 availableScreens.removeOne(cScreen); 97 128 }
Note:
See TracChangeset
for help on using the changeset viewer.