Changeset 45402 in vbox
- Timestamp:
- Apr 8, 2013 12:32:55 PM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.cpp
r45374 r45402 61 61 const char* UIDefs::GUI_VirtualScreenToHostScreen = "GUI/VirtualScreenToHostScreen"; 62 62 const char* UIDefs::GUI_AutoresizeGuest = "GUI/AutoresizeGuest"; 63 const char* UIDefs::GUI_AutomountGuestScreens = "GUI/AutomountGuestScreens"; 63 64 const char* UIDefs::GUI_SaveMountedAtRuntime = "GUI/SaveMountedAtRuntime"; 64 65 const char* UIDefs::GUI_PassCAD = "GUI/PassCAD"; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h
r45374 r45402 138 138 extern const char* GUI_VirtualScreenToHostScreen; 139 139 extern const char* GUI_AutoresizeGuest; 140 extern const char* GUI_AutomountGuestScreens; 140 141 extern const char* GUI_SaveMountedAtRuntime; 141 142 extern const char* GUI_PassCAD; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r45377 r45402 3735 3735 /* 'true' if hiding is not approved by the extra-data: */ 3736 3736 return !isApprovedByExtraData(machine, GUI_HideDetails); 3737 } 3738 3739 /* static */ 3740 bool VBoxGlobal::shouldWeAutoMountGuestScreens(CMachine &machine, 3741 bool fIncludingSanityCheck /*= true*/) 3742 { 3743 if (fIncludingSanityCheck) 3744 { 3745 /* 'false' for null machines, 3746 * there is nothing to start anyway: */ 3747 if (machine.isNull()) 3748 return false; 3749 3750 /* 'false' for inaccessible machines, 3751 * we can't start them anyway: */ 3752 if (!machine.GetAccessible()) 3753 return false; 3754 } 3755 3756 /* 'true' if guest-screen auto-mounting approved by the extra-data: */ 3757 return isApprovedByExtraData(machine, GUI_AutomountGuestScreens); 3737 3758 } 3738 3759 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r45377 r45402 379 379 static bool shouldWeShowDetails(CMachine &machine, 380 380 bool fIncludingMachineGeneralCheck = false); 381 static bool shouldWeAutoMountGuestScreens(CMachine &machine, bool fIncludingSanityCheck = true); 381 382 382 383 #ifdef RT_OS_LINUX -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp
r45333 r45402 30 30 #include "UISession.h" 31 31 #include "UIMessageCenter.h" 32 #include "VBoxGlobal.h" 32 33 33 34 /* COM includes: */ … … 75 76 * and all guests screens need there own host screen. */ 76 77 CMachine machine = m_pMachineLogic->session().GetMachine(); 78 CDisplay display = m_pMachineLogic->session().GetConsole().GetDisplay(); 79 bool fShouldWeAutoMountGuestScreens = VBoxGlobal::shouldWeAutoMountGuestScreens(machine, false); 77 80 QDesktopWidget *pDW = QApplication::desktop(); 78 81 foreach (int iGuestScreen, m_guestScreens) … … 135 138 availableScreens.removeOne(iHostScreen); 136 139 } 140 /* Do we have opinion about what to do with excessive guest-screen? */ 141 else if (fShouldWeAutoMountGuestScreens) 142 { 143 /* Then we have to disable excessive guest-screen: */ 144 display.SetVideoModeHint(iGuestScreen, false, false, 0, 0, 0, 0, 0); 145 } 146 } 147 148 /* Are we still have available host-screens 149 * and have opinion about what to do with disabled guest-screens? */ 150 if (!availableScreens.isEmpty() && fShouldWeAutoMountGuestScreens) 151 { 152 /* How many excessive host-screens do we have? */ 153 int cExcessiveHostScreens = availableScreens.size(); 154 /* How many disabled guest-screens do we have? */ 155 int cDisabledGuestScreens = m_disabledGuestScreens.size(); 156 /* We have to try to enable disabled guest-screens if any: */ 157 int cGuestScreensToEnable = qMin(cExcessiveHostScreens, cDisabledGuestScreens); 158 for (int iGuestScreenIndex = 0; iGuestScreenIndex < cGuestScreensToEnable; ++iGuestScreenIndex) 159 { 160 /* Get corresponding guest-screen: */ 161 int iGuestScreen = m_disabledGuestScreens[iGuestScreenIndex]; 162 /* Re-enable guest-screen with the old arguments: */ 163 ULONG iWidth, iHeight, iBpp; 164 display.GetScreenResolution(iGuestScreen, iWidth, iHeight, iBpp); 165 display.SetVideoModeHint(iGuestScreen, true, false, 0, 0, iWidth, iHeight, iBpp); 166 } 137 167 } 138 168 … … 254 284 /* Get machine: */ 255 285 CMachine machine = m_pMachineLogic->session().GetMachine(); 256 /* Enumerate all the visibleguest screens: */286 /* Enumerate all the guest screens: */ 257 287 m_guestScreens.clear(); 288 m_disabledGuestScreens.clear(); 258 289 for (uint iGuestScreen = 0; iGuestScreen < machine.GetMonitorCount(); ++iGuestScreen) 259 290 if (m_pMachineLogic->uisession()->isScreenVisible(iGuestScreen)) 260 291 m_guestScreens << iGuestScreen; 292 else 293 m_disabledGuestScreens << iGuestScreen; 261 294 } 262 295 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.h
r44839 r45402 82 82 UIMachineLogic *m_pMachineLogic; 83 83 QList<int> m_guestScreens; 84 QList<int> m_disabledGuestScreens; 84 85 int m_cHostScreens; 85 86 QMap<int, int> m_screenMap;
Note:
See TracChangeset
for help on using the changeset viewer.