Changeset 26955 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Mar 2, 2010 4:02:37 PM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r26952 r26955 289 289 } 290 290 else 291 /* Discard the temporary create new state: */291 /* Discard the temporary created new state: */ 292 292 delete pNewVisualState; 293 293 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp
r26954 r26955 58 58 bool UIMachineLogicFullscreen::checkAvailability() 59 59 { 60 /* Temporary get a machine object */ 61 const CMachine &machine = uisession()->session().GetMachine(); 62 const CConsole &console = uisession()->session().GetConsole(); 63 64 #if (QT_VERSION >= 0x040600) 65 int cHostScreens = QApplication::desktop()->screenCount(); 66 #else /* (QT_VERSION >= 0x040600) */ 60 67 int cHostScreens = QApplication::desktop()->numScreens(); 61 int cGuestScreens = uisession()->session().GetMachine().GetMonitorCount(); 68 #endif /* !(QT_VERSION >= 0x040600) */ 69 70 int cGuestScreens = machine.GetMonitorCount(); 62 71 /* Check that there are enough physical screens are connected */ 63 72 if (cHostScreens < cGuestScreens) 64 73 { 65 74 vboxProblem().cannotEnterFullscreenMode(); 66 setPreventAutoStart(true);67 75 return false; 68 76 } 77 78 // TODO_NEW_CORE: this is how it looked in the old version 79 // bool VBoxConsoleView::isAutoresizeGuestActive() { return mGuestSupportsGraphics && mAutoresizeGuest; } 80 // if (uisession()->session().GetConsole().isAutoresizeGuestActive()) 81 if (uisession()->isGuestAdditionsActive()) 82 { 83 ULONG64 availBits = machine.GetVRAMSize() /* VRAM */ 84 * _1M /* MB to bytes */ 85 * 8; /* to bits */ 86 ULONG guestBpp = console.GetDisplay().GetBitsPerPixel(); 87 ULONG64 usedBits = 0; 88 for (int i = 0; i < cGuestScreens; ++i) 89 { 90 // TODO_NEW_CORE: really take the screen geometry into account the 91 // different fb will be displayed. */ 92 QRect screen = QApplication::desktop()->screenGeometry(i); 93 usedBits += screen.width() /* display width */ 94 * screen.height() /* display height */ 95 * guestBpp 96 + _1M * 8; /* current cache per screen - may be changed in future */ 97 } 98 usedBits += 4096 * 8; /* adapter info */ 99 100 if (availBits < usedBits) 101 { 102 // int result = vboxProblem().cannotEnterFullscreenMode(screen.width(), screen.height(), guestBpp, 103 // (((usedBits + 7) / 8 + _1M - 1) / _1M) * _1M); 104 int result = vboxProblem().cannotEnterFullscreenMode(0, 0, guestBpp, 105 (((usedBits + 7) / 8 + _1M - 1) / _1M) * _1M); 106 if (result == QIMessageBox::Cancel) 107 return false; 108 } 109 } 110 69 111 70 112 return true; … … 136 178 } 137 179 138 void UIMachineLogicFullscreen::prepareRequiredFeatures()139 {140 // TODO_NEW_CORE141 // if (session().GetConsole().isAutoresizeGuestActive())142 // {143 // ULONG64 availBits = session().GetMachine().GetVRAMSize() /* VRAM */144 // * _1M /* MB to bytes */145 // * 8; /* to bits */146 // for (ulong uScreenId = 0; uScreenId < uMonitorCount; ++ uScreenId)147 // {148 // QRect screen = QApplication::desktop()->screenGeometry(this);149 // ULONG guestBpp = mConsole->console().GetDisplay().GetBitsPerPixel();150 // ULONG64 usedBits = (screen.width() /* display width */151 // * screen.height() /* display height */152 // * guestBpp153 // + _1M * 8) /* current cache per screen - may be changed in future */154 // * session().GetMachine().GetMonitorCount() /**< @todo fix assumption that all screens have same resolution */155 // + 4096 * 8; /* adapter info */156 // }157 //158 // if (availBits < usedBits)159 // {160 // int result = vboxProblem().cannotEnterFullscreenMode(161 // screen.width(), screen.height(), guestBpp,162 // (((usedBits + 7) / 8 + _1M - 1) / _1M) * _1M);163 // if (result == QIMessageBox::Cancel)164 // sltClose();165 // }166 // }167 //168 UIMachineLogic::prepareRequiredFeatures();169 }170 171 180 void UIMachineLogicFullscreen::prepareMachineWindows() 172 181 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.h
r26950 r26955 57 57 void prepareActionConnections(); 58 58 void prepareMachineWindows(); 59 void prepareRequiredFeatures();60 59 61 60 /* Cleanup helpers: */
Note:
See TracChangeset
for help on using the changeset viewer.