Changeset 44834 in vbox
- Timestamp:
- Feb 26, 2013 4:58:48 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 83974
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp
r44833 r44834 63 63 void UIMultiScreenLayout::update() 64 64 { 65 CMachine machine = m_pMachineLogic->session().GetMachine(); 66 /* Make a pool of available host screens. */ 65 /* Make a pool of available host screens: */ 67 66 QList<int> availableScreens; 68 67 for (int i = 0; i < m_cHostScreens; ++i) 69 68 availableScreens << i; 70 /* Load all combinations stored in the settings file. We have to make sure 71 * they are valid, which means there have to be unique combinations and all 72 * guests screens need there own host screen. */ 69 70 /* Load all combinations stored in the settings file. 71 * We have to make sure they are valid, which means there have to be unique combinations 72 * and all guests screens need there own host screen. */ 73 CMachine machine = m_pMachineLogic->session().GetMachine(); 73 74 QDesktopWidget *pDW = QApplication::desktop(); 74 75 for (int i = 0; i < m_cGuestScreens; ++i) … … 84 85 { 85 86 /* If not, check the position of the guest window in normal mode. 86 * This makes sure that on first use the window opens on the same 87 * screen as the normal window was before. This even works with 88 * multi-screen. The user just have to move all the normal windows 89 * to the target screens and they will magically open there in 90 * seamless/fullscreen also. */ 87 * This makes sure that on first use the window opens on the same screen as the normal window was before. 88 * This even works with multi-screen. The user just have to move all the normal windows to the target screens 89 * and they will magically open there in seamless/fullscreen also. */ 91 90 QString strTest1 = machine.GetExtraData(GUI_LastNormalWindowPosition + (i > 0 ? QString::number(i): "")); 92 91 QRegExp posParser("(-?\\d+),(-?\\d+),(-?\\d+),(-?\\d+)"); 93 92 if (posParser.exactMatch(strTest1)) 94 93 { 95 /* If parsing was successfully, convert it to a position .*/94 /* If parsing was successfully, convert it to a position: */ 96 95 bool fOk1, fOk2; 97 96 QPoint p(posParser.cap(1).toInt(&fOk1), posParser.cap(2).toInt(&fOk2)); 98 /* Check to which screen the position belongs .*/97 /* Check to which screen the position belongs: */ 99 98 cScreen = pDW->screenNumber(p); 100 99 if (!( fOk1 /* Valid data */ … … 102 101 && cScreen >= 0 && cScreen < m_cHostScreens /* In the host screen bounds? */ 103 102 && m_screenMap.key(cScreen, -1) == -1)) /* Not taken already? */ 104 /* If not, simply pick the next one of the still available 105 * host screens. */ 103 /* If not, simply pick the next one of the still available host screens: */ 106 104 cScreen = availableScreens.first(); 107 105 } 108 106 else 109 /* If not, simply pick the next one of the still available host 110 * screens. */ 107 /* If not, simply pick the next one of the still available host screens: */ 111 108 cScreen = availableScreens.first(); 112 109 } 113 110 m_screenMap.insert(i, cScreen); 114 /* Remove the just selected screen from the list of available screens.*/111 /* Remove the just selected screen from the list of available: */ 115 112 availableScreens.removeOne(cScreen); 116 113 } … … 160 157 void UIMultiScreenLayout::sltScreenLayoutChanged(QAction *pAction) 161 158 { 159 /* Parse incoming information: */ 162 160 int a = pAction->data().toInt(); 163 161 int cGuestScreen = RT_LOWORD(a); 164 162 int cHostScreen = RT_HIWORD(a); 165 163 166 CMachine machine = m_pMachineLogic->session().GetMachine();167 QMap<int,int> tmpMap(m_screenMap);168 164 /* Search for the virtual screen which is currently displayed on the 169 165 * requested host screen. When there is one found, we swap both. */ 166 QMap<int,int> tmpMap(m_screenMap); 170 167 int r = tmpMap.key(cHostScreen, -1); 171 168 if (r != -1) … … 174 171 tmpMap.insert(cGuestScreen, cHostScreen); 175 172 173 /* Check the memory requirements first: */ 176 174 bool fSuccess = true; 175 CMachine machine = m_pMachineLogic->session().GetMachine(); 177 176 if (m_pMachineLogic->uisession()->isGuestAdditionsActive()) 178 177 { … … 181 180 * 8; /* to bits */ 182 181 quint64 usedBits = memoryRequirements(tmpMap); 183 184 182 fSuccess = availBits >= usedBits; 185 183 if (!fSuccess) 186 184 { 187 /* We have to little video memory for the new layout, so say it to the 188 * user and revert all changes. */ 185 /* We have too little video memory for the new layout, so say it to the user and revert all the changes: */ 189 186 if (m_pMachineLogic->visualStateType() == UIVisualStateType_Seamless) 190 187 msgCenter().cannotSwitchScreenInSeamless((((usedBits + 7) / 8 + _1M - 1) / _1M) * _1M); … … 218 215 void UIMultiScreenLayout::calculateGuestScreenCount() 219 216 { 217 /* Get machine: */ 220 218 CMachine machine = m_pMachineLogic->session().GetMachine(); 219 /* Get the amount of the guest screens: */ 221 220 m_cGuestScreens = machine.GetMonitorCount(); 222 221 }
Note:
See TracChangeset
for help on using the changeset viewer.