Changeset 38978 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Oct 12, 2011 1:33:28 PM (13 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxDefs.cpp
r38900 r38978 33 33 const char* VBoxDefs::GUI_LastWindowState_Max = "max"; 34 34 const char* VBoxDefs::GUI_LastGuestSizeHint = "GUI/LastGuestSizeHint"; 35 const char* VBoxDefs::GUI_LastGuestSizeHintWasFullscreen = "GUI/LastGuestSizeHintWasFullscreen"; 35 36 const char* VBoxDefs::GUI_Toolbar = "GUI/Toolbar"; 36 37 const char* VBoxDefs::GUI_Statusbar = "GUI/Statusbar"; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxDefs.h
r38900 r38978 116 116 static const char* GUI_Statusbar; 117 117 static const char* GUI_LastGuestSizeHint; 118 static const char* GUI_LastGuestSizeHintWasFullscreen; 118 119 static const char* GUI_Fullscreen; 119 120 static const char* GUI_Seamless; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r38963 r38978 113 113 #endif /* VBOX_WITH_VIDEOHWACCEL */ 114 114 ); 115 pMachineView->m_fIsFullscreen = true; 115 116 break; 116 117 case UIVisualStateType_Seamless: … … 121 122 #endif /* VBOX_WITH_VIDEOHWACCEL */ 122 123 ); 124 pMachineView->m_fIsFullscreen = true; 123 125 break; 124 126 case UIVisualStateType_Scale: … … 160 162 /* Send new size-hint to the guest: */ 161 163 session().GetConsole().GetDisplay().SetVideoModeHint(newSize.width(), newSize.height(), 0, screenId()); 164 /* And track whether we have had a "normal" resize since the last 165 * fullscreen resize hint was sent: */ 166 machine.SetExtraData(VBoxDefs::GUI_LastGuestSizeHintWasFullscreen, 167 m_fIsFullscreen ? "true" : ""); 162 168 } 163 169 … … 226 232 ) 227 233 : QAbstractScrollArea(pMachineWindow->machineWindow()) 234 , m_fIsFullscreen(false) 228 235 , m_pMachineWindow(pMachineWindow) 229 236 , m_uScreenId(uScreenId) -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
r38957 r38978 71 71 /* Utility signals: */ 72 72 void resizeHintDone(); 73 74 private: 75 76 /** Is this a fullscreen-type view? */ 77 bool m_fIsFullscreen; 73 78 74 79 protected slots: -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp
r38963 r38978 52 52 ) 53 53 , m_bIsGuestAutoresizeEnabled(gActionPool->action(UIActionIndexRuntime_Toggle_GuestAutoresize)->isChecked()) 54 , m_pSyncBlocker(0)55 54 { 56 55 /* Load machine view settings: */ … … 72 71 prepareConsoleConnections(); 73 72 74 /* Prepare fullscreen: */75 prepareFullscreen();76 77 73 /* Initialization: */ 78 74 sltMachineStateChanged(); … … 81 77 UIMachineViewFullscreen::~UIMachineViewFullscreen() 82 78 { 83 /* Cleanup fullscreen: */84 cleanupFullscreen();85 86 79 /* Cleanup frame buffer: */ 87 80 cleanupFrameBuffer(); … … 153 146 emit resizeHintDone(); 154 147 155 /* Unlock after processing guest resize event: */156 if (m_pSyncBlocker && m_pSyncBlocker->isRunning())157 m_pSyncBlocker->quit();158 159 148 pEvent->accept(); 160 149 return true; … … 181 170 /* Send guest-resize hint only if top window resizing to required dimension: */ 182 171 QResizeEvent *pResizeEvent = static_cast<QResizeEvent*>(pEvent); 172 /** @todo why is this here? If it is a workaround 173 * for some situation that should be documented. */ 183 174 if (pResizeEvent->size() != workingArea().size()) 184 175 break; … … 239 230 } 240 231 241 void UIMachineViewFullscreen::prepareFullscreen()242 {243 /* Create sync-blocker: */244 m_pSyncBlocker = new UIMachineViewBlocker;245 }246 247 void UIMachineViewFullscreen::cleanupFullscreen()248 {249 /* If machine still running: */250 if (uisession()->isRunning())251 {252 /* And guest supports advanced graphics management which is enabled: */253 if (m_bIsGuestAutoresizeEnabled && uisession()->isGuestSupportsGraphics())254 {255 /* Rollback seamless frame-buffer size to normal: */256 machineWindowWrapper()->machineWindow()->hide();257 sltPerformGuestResize(guestSizeHint());258 m_pSyncBlocker->exec();259 260 /* Request to delete sync-blocker: */261 m_pSyncBlocker->deleteLater();262 }263 }264 }265 266 232 void UIMachineViewFullscreen::setGuestAutoresizeEnabled(bool fEnabled) 267 233 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.h
r38947 r38978 58 58 void prepareConnections(); 59 59 void prepareConsoleConnections(); 60 void prepareFullscreen();61 60 62 61 /* Cleanup routines: */ 63 void cleanupFullscreen();64 62 //void cleanupConsoleConnections() {} 65 63 //void cleanupConnections() {} … … 78 76 /* Private variables: */ 79 77 bool m_bIsGuestAutoresizeEnabled : 1; 80 UIMachineViewBlocker *m_pSyncBlocker;81 78 82 79 /* Friend classes: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp
r38963 r38978 88 88 /* Check if we should restrict minimum size: */ 89 89 maybeRestrictMinimumSize(); 90 91 /* Resend the last resize hint if there was a fullscreen or 92 * seamless transition previously. If we were not in graphical 93 * mode initially after the transition this happens when we 94 * switch. */ 95 maybeResendResizeHint(); 90 96 } 91 97 … … 253 259 } 254 260 261 void UIMachineViewNormal::maybeResendResizeHint() 262 { 263 if (m_bIsGuestAutoresizeEnabled && uisession()->isGuestSupportsGraphics()) 264 { 265 /* Get the current machine: */ 266 CMachine machine = session().GetMachine(); 267 268 /* We send a guest size hint if needed to reverse a transition 269 * to fullscreen or seamless. */ 270 QString strHintSent = machine.GetExtraData(VBoxDefs::GUI_LastGuestSizeHintWasFullscreen); 271 if (!strHintSent.isEmpty()) 272 sltPerformGuestResize(guestSizeHint()); 273 } 274 } 275 255 276 void UIMachineViewNormal::saveMachineViewSettings() 256 277 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.h
r38962 r38978 65 65 void prepareConsoleConnections(); 66 66 //void loadMachineViewSettings(); 67 void maybeResendResizeHint(); 67 68 68 69 /* Cleanup helpers: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp
r38963 r38978 50 50 #endif 51 51 ) 52 , m_pSyncBlocker(0)53 52 { 54 53 /* Load machine view settings: */ … … 160 159 /* Emit a signal about guest was resized: */ 161 160 emit resizeHintDone(); 162 163 /* Unlock after processing guest resize event: */164 if (m_pSyncBlocker && m_pSyncBlocker->isRunning())165 m_pSyncBlocker->quit();166 161 167 162 pEvent->accept(); … … 251 246 /* Set seamless feature flag to the guest: */ 252 247 session().GetConsole().GetDisplay().SetSeamlessMode(true); 253 /* Create sync-blocker: */254 m_pSyncBlocker = new UIMachineViewBlocker;255 248 } 256 249 … … 259 252 /* If machine still running: */ 260 253 if (uisession()->isRunning()) 261 {262 254 /* Reset seamless feature flag of the guest: */ 263 255 session().GetConsole().GetDisplay().SetSeamlessMode(false); 264 265 /* Rollback seamless frame-buffer size to normal: */266 machineWindowWrapper()->machineWindow()->hide();267 sltPerformGuestResize(guestSizeHint());268 m_pSyncBlocker->exec();269 270 /* Delete sync-blocker: */271 m_pSyncBlocker->deleteLater();272 }273 256 } 274 257 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.h
r38947 r38978 80 80 /* Private variables: */ 81 81 QRegion m_lastVisibleRegion; 82 UIMachineViewBlocker *m_pSyncBlocker;83 82 84 83 /* Friend classes: */
Note:
See TracChangeset
for help on using the changeset viewer.