Changeset 52705 in vbox
- Timestamp:
- Sep 11, 2014 3:12:06 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 96041
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r52686 r52705 271 271 } 272 272 273 /** Adjusts guest screen size for each the machine-window we have. */ 274 void UIMachineLogic::maybeAdjustGuestScreenSize() 275 { 273 void UIMachineLogic::adjustMachineWindowsGeometry() 274 { 275 /* By default, the only thing we need is to 276 * adjust machine-view size(s) if necessary: */ 276 277 foreach(UIMachineWindow *pMachineWindow, machineWindows()) 277 pMachineWindow-> machineView()->maybeAdjustGuestScreenSize();278 pMachineWindow->adjustMachineViewSize(); 278 279 } 279 280 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r52298 r52705 91 91 void setPreventAutoClose(bool fIsPreventAutoClose) { m_fIsPreventAutoClose = fIsPreventAutoClose; } 92 92 93 /* API: Guest screen size stuff:*/94 virtual void maybeAdjustGuestScreenSize();93 /** Adjusts machine-window(s) geometry if necessary. */ 94 virtual void adjustMachineWindowsGeometry(); 95 95 96 96 /* Wrapper to open Machine settings / Network page: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
r52202 r52705 85 85 virtual void setGuestAutoresizeEnabled(bool /* fEnabled */) {} 86 86 87 /** Adjusts guest screen size to correspond current machine-window size.87 /** Adjusts guest-screen size to correspond current visual-style. 88 88 * @note Reimplemented in sub-classes. Base implementation does nothing. */ 89 virtual void maybeAdjustGuestScreenSize() {}89 virtual void adjustGuestScreenSize() {} 90 90 91 91 /* Framebuffer aspect ratio: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp
r52298 r52705 210 210 } 211 211 212 void UIMachineWindow::adjustMachineViewSize() 213 { 214 /* By default, the only thing we need is to 215 * adjust guest-screen size if necessary: */ 216 machineView()->adjustGuestScreenSize(); 217 } 218 212 219 #ifndef VBOX_WITH_TRANSLUCENT_SEAMLESS 213 220 void UIMachineWindow::setMask(const QRegion ®ion) -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h
r52298 r52705 70 70 CMachine machine() const; 71 71 72 /** Adjusts machine-window size to correspond current guest screensize.72 /** Adjusts machine-window size to correspond current machine-view size. 73 73 * @param fAdjustPosition determines whether is it necessary to adjust position too. 74 74 * @note Reimplemented in sub-classes. Base implementation does nothing. */ 75 75 virtual void normalizeGeometry(bool fAdjustPosition) { Q_UNUSED(fAdjustPosition); } 76 77 /** Adjusts machine-view size to correspond current machine-window size. */ 78 virtual void adjustMachineViewSize(); 76 79 77 80 #ifndef VBOX_WITH_TRANSLUCENT_SEAMLESS -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r52645 r52705 282 282 { 283 283 msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_state_restore_90px.png", 0, 0); 284 /* After restoring from 'saved' state, guest screen sizeshould be adjusted: */285 machineLogic()-> maybeAdjustGuestScreenSize();284 /* After restoring from 'saved' state, machine-window(s) geometry should be adjusted: */ 285 machineLogic()->adjustMachineWindowsGeometry(); 286 286 } 287 287 else -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp
r52512 r52705 98 98 } 99 99 100 /** Adjusts guest screen count/size for the machine-logic we have. */ 101 void UIMachineLogicFullscreen::maybeAdjustGuestScreenSize() 102 { 103 LogRel(("UIMachineLogicFullscreen::maybeAdjustGuestScreenSize")); 100 void UIMachineLogicFullscreen::adjustMachineWindowsGeometry() 101 { 102 LogRel(("UIMachineLogicFullscreen::adjustMachineWindowsGeometry\n")); 104 103 105 104 /* Rebuild multi-screen layout: */ … … 114 113 pMachineWindow->showInNecessaryMode(); 115 114 } 116 /* Revalidate native fullscreen for ML and next: */115 /* For ML and next revalidate native fullscreen: */ 117 116 else revalidateNativeFullScreen(); 118 117 #else /* !Q_WS_MAC */ … … 363 362 if (uisession()->isRunning() && uisession()->wasPaused()) 364 363 { 365 LogRel Flow(("UIMachineLogicFullscreen:"366 367 "Updating screen-layout...\n"));364 LogRel(("UIMachineLogicFullscreen::sltMachineStateChanged:" 365 "Machine-state changed from 'paused' to 'running': " 366 "Adjust machine-window geometry...\n")); 368 367 369 368 /* Make sure further code will be called just once: */ 370 369 uisession()->forgetPreviousMachineState(); 371 /* Adjust guest-screen sizeif necessary: */372 maybeAdjustGuestScreenSize();370 /* Adjust machine-window geometry if necessary: */ 371 adjustMachineWindowsGeometry(); 373 372 } 374 373 } … … 802 801 "Ask machine-window #%d to adjust guest geometry.\n", (int)uScreenID)); 803 802 804 /* Adjust guest screensize if necessary: */805 pMachineWindow-> machineView()->maybeAdjustGuestScreenSize();803 /* Just adjust machine-view size if necessary: */ 804 pMachineWindow->adjustMachineViewSize(); 806 805 } 807 806 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.h
r52512 r52705 62 62 virtual Qt::WindowFlags windowFlags(ulong uScreenId) const; 63 63 64 /** Adjusts machine-window geometry if necessary for 'Fullscreen'. */ 65 virtual void adjustMachineWindowsGeometry(); 66 64 67 /* Helpers: Multi-screen stuff: */ 65 void maybeAdjustGuestScreenSize();66 68 int hostScreenForGuestScreen(int iScreenId) const; 67 69 bool hasHostScreenForGuestScreen(int iScreenId) const; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp
r52202 r52705 63 63 void UIMachineViewFullscreen::sltAdditionsStateChanged() 64 64 { 65 maybeAdjustGuestScreenSize();65 adjustGuestScreenSize(); 66 66 } 67 67 … … 136 136 } 137 137 138 /** Adjusts guest screen size to correspond current <i>working area</i> size. */ 139 void UIMachineViewFullscreen::maybeAdjustGuestScreenSize() 138 void UIMachineViewFullscreen::adjustGuestScreenSize() 140 139 { 141 /* Check if we should adjust guest to new size: */140 /* Check if we should adjust guest-screen to new size: */ 142 141 if (frameBuffer()->isAutoEnabled() || 143 142 (int)frameBuffer()->width() != workingArea().size().width() || -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.h
r49177 r52705 62 62 void setGuestAutoresizeEnabled(bool bEnabled); 63 63 64 /** Adjusts guest-screen size to correspond current <i>working area</i> size. */ 65 void adjustGuestScreenSize(); 66 64 67 /* Helpers: Geometry stuff: */ 65 void maybeAdjustGuestScreenSize();66 68 QRect workingArea() const; 67 69 QSize calculateMaxGuestSize() const; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp
r52638 r52705 347 347 return; 348 348 349 /* Which host-screen should that machine-window located on? */350 const int iHostScreen = pFullscreenLogic->hostScreenForGuestScreen(m_uScreenId);351 352 349 #ifdef Q_WS_X11 353 350 /* On X11 calling placeOnScreen() is only needed for legacy window managers … … 381 378 * Apparently some window managers will not respond to requests for 382 379 * unmapped windows, so do this *after* the call to showFullScreen(). */ 383 VBoxGlobal::setFullScreenMonitorX11(this, iHostScreen);380 VBoxGlobal::setFullScreenMonitorX11(this, pFullscreenLogic->hostScreenForGuestScreen(m_uScreenId)); 384 381 } 385 382 else … … 392 389 #endif /* Q_WS_X11 */ 393 390 394 /* Adjust guest-screensize if necessary: */395 machineView()->maybeAdjustGuestScreenSize();396 397 /* Show /Move mini-toolbar into appropriate place: */391 /* Adjust machine-view size if necessary: */ 392 adjustMachineViewSize(); 393 394 /* Show mini-toolbar: */ 398 395 if (m_pMiniToolBar) 399 {400 396 m_pMiniToolBar->show(); 401 m_pMiniToolBar->adjustGeometry(iHostScreen);402 }403 397 404 398 /* Make sure machine-view have focus: */ 405 399 m_pMachineView->setFocus(); 400 } 401 402 void UIMachineWindowFullscreen::adjustMachineViewSize() 403 { 404 /* Call to base-class: */ 405 UIMachineWindow::adjustMachineViewSize(); 406 407 /* If mini-toolbar present: */ 408 if (m_pMiniToolBar) 409 { 410 /* Make sure this window has fullscreen logic: */ 411 UIMachineLogicFullscreen *pFullscreenLogic = qobject_cast<UIMachineLogicFullscreen*>(machineLogic()); 412 AssertPtrReturnVoid(pFullscreenLogic); 413 414 /* Which host-screen should that machine-window located on? */ 415 const int iHostScreen = pFullscreenLogic->hostScreenForGuestScreen(m_uScreenId); 416 417 /* Move mini-toolbar into appropriate place: */ 418 m_pMiniToolBar->adjustGeometry(iHostScreen); 419 } 406 420 } 407 421 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h
r52129 r52705 86 86 void showInNecessaryMode(); 87 87 88 /** Adjusts machine-view size to correspond current machine-window size. */ 89 virtual void adjustMachineViewSize(); 90 88 91 /* Update stuff: */ 89 92 void updateAppearanceOf(int iElement); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp
r52638 r52705 65 65 void UIMachineViewNormal::sltAdditionsStateChanged() 66 66 { 67 maybeAdjustGuestScreenSize();67 adjustGuestScreenSize(); 68 68 } 69 69 … … 161 161 } 162 162 163 /** Adjusts guest screen size to correspond current machine-window size. */ 164 void UIMachineViewNormal::maybeAdjustGuestScreenSize() 165 { 166 /* Check if we should adjust guest to new size: */ 167 QSize centralWidgetSize = machineWindow()->centralWidget()->size(); 163 void UIMachineViewNormal::adjustGuestScreenSize() 164 { 165 /* Check if we should adjust guest-screen to new size: */ 166 const QSize centralWidgetSize = machineWindow()->centralWidget()->size(); 168 167 if ((int)frameBuffer()->width() != centralWidgetSize.width() || 169 168 (int)frameBuffer()->height() != centralWidgetSize.height()) -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.h
r52246 r52705 67 67 void maybeResendSizeHint(); 68 68 69 /** Adjusts guest-screen size to correspond current <i>machine-window</i> size. */ 70 void adjustGuestScreenSize(); 71 69 72 /* Private helpers: */ 70 void maybeAdjustGuestScreenSize();71 73 QRect workingArea() const; 72 74 QSize calculateMaxGuestSize() const; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp
r52478 r52705 85 85 } 86 86 87 /** Adjusts guest screen count/size for the machine-logic we have. */ 88 void UIMachineLogicSeamless::maybeAdjustGuestScreenSize() 89 { 90 LogRel(("UIMachineLogicSeamless::maybeAdjustGuestScreenSize")); 87 void UIMachineLogicSeamless::adjustMachineWindowsGeometry() 88 { 89 LogRel(("UIMachineLogicSeamless::adjustMachineWindowsGeometry\n")); 91 90 92 91 /* Rebuild multi-screen layout: */ … … 144 143 if (uisession()->isRunning() && uisession()->wasPaused()) 145 144 { 146 LogRel Flow(("UIMachineLogicSeamless:"147 148 "Updating screen-layout...\n"));145 LogRel(("UIMachineLogicSeamless::sltMachineStateChanged:" 146 "Machine-state changed from 'paused' to 'running': " 147 "Adjust machine-window geometry...\n")); 149 148 150 149 /* Make sure further code will be called just once: */ 151 150 uisession()->forgetPreviousMachineState(); 152 /* Adjust guest-screen sizeif necessary: */153 maybeAdjustGuestScreenSize();151 /* Adjust machine-window geometry if necessary: */ 152 adjustMachineWindowsGeometry(); 154 153 } 155 154 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.h
r52298 r52705 41 41 virtual Qt::WindowFlags windowFlags(ulong uScreenId) const { Q_UNUSED(uScreenId); return Qt::FramelessWindowHint; } 42 42 43 /** Adjusts machine-window geometry if necessary for 'Seamless'. */ 44 virtual void adjustMachineWindowsGeometry(); 45 43 46 /* Helpers: Multi-screen stuff: */ 44 void maybeAdjustGuestScreenSize();45 47 int hostScreenForGuestScreen(int iScreenId) const; 46 48 bool hasHostScreenForGuestScreen(int iScreenId) const; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp
r49322 r52705 72 72 void UIMachineViewSeamless::sltAdditionsStateChanged() 73 73 { 74 maybeAdjustGuestScreenSize();74 adjustGuestScreenSize(); 75 75 } 76 76 … … 154 154 } 155 155 156 /** Adjusts guest screen size to correspond current <i>working area</i> size. */ 157 void UIMachineViewSeamless::maybeAdjustGuestScreenSize() 156 void UIMachineViewSeamless::adjustGuestScreenSize() 158 157 { 159 /* Check if we should adjust guest to new size: */158 /* Check if we should adjust guest-screen to new size: */ 160 159 if (frameBuffer()->isAutoEnabled() || 161 160 (int)frameBuffer()->width() != workingArea().size().width() || -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.h
r49177 r52705 64 64 //void cleanupCommon() {} 65 65 66 /** Adjusts guest-screen size to correspond current <i>working area</i> size. */ 67 void adjustGuestScreenSize(); 68 66 69 /* Helpers: Geometry stuff: */ 67 void maybeAdjustGuestScreenSize();68 70 QRect workingArea() const; 69 71 QSize calculateMaxGuestSize() const; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp
r52638 r52705 200 200 show(); 201 201 202 /* Adjust guest screen size if necessary: */ 203 machineView()->maybeAdjustGuestScreenSize(); 204 205 #ifndef Q_WS_MAC 206 /* Show/Move mini-toolbar into appropriate place: */ 202 /* Adjust machine-view size if necessary: */ 203 adjustMachineViewSize(); 204 205 #ifndef Q_WS_MAC 206 /* Show mini-toolbar: */ 207 if (m_pMiniToolBar) 208 m_pMiniToolBar->show(); 209 #endif /* !Q_WS_MAC */ 210 211 /* Make sure machine-view have focus: */ 212 m_pMachineView->setFocus(); 213 } 214 215 void UIMachineWindowSeamless::adjustMachineViewSize() 216 { 217 /* Call to base-class: */ 218 UIMachineWindow::adjustMachineViewSize(); 219 220 #ifndef Q_WS_MAC 221 /* If mini-toolbar present: */ 207 222 if (m_pMiniToolBar) 208 223 { 209 m_pMiniToolBar->show(); 210 m_pMiniToolBar->adjustGeometry(); 224 /* Make sure this window has seamless logic: */ 225 const UIMachineLogicFullscreen *pSeamlessLogic = qobject_cast<UIMachineLogicSeamless*>(machineLogic()); 226 AssertPtrReturnVoid(pSeamlessLogic); 227 228 /* Which host-screen should that machine-window located on? */ 229 const int iHostScreen = pSeamlessLogic->hostScreenForGuestScreen(m_uScreenId); 230 231 /* Move mini-toolbar into appropriate place: */ 232 m_pMiniToolBar->adjustGeometry(iHostScreen); 211 233 } 212 234 #endif /* !Q_WS_MAC */ 213 214 /* Make sure machine-view have focus: */215 m_pMachineView->setFocus();216 235 } 217 236 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.h
r52129 r52705 64 64 void showInNecessaryMode(); 65 65 66 /** Adjusts machine-view size to correspond current machine-window size. */ 67 virtual void adjustMachineViewSize(); 68 66 69 #ifndef Q_WS_MAC 67 70 /* Update routines: */
Note:
See TracChangeset
for help on using the changeset viewer.