- Timestamp:
- Nov 24, 2014 4:19:34 PM (10 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r53372 r53389 3568 3568 strKey == GUI_StatusBar_IndicatorOrder) 3569 3569 emit sigStatusBarConfigurationChange(strMachineID); 3570 /* Scale-factor change: */ 3571 else if (strKey == GUI_ScaleFactor) 3572 emit sigScaleFactorChange(strMachineID); 3570 3573 } 3571 3574 -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r53372 r53389 75 75 /** Notifies about HID LEDs synchronization state change. */ 76 76 void sigHidLedsSyncStateChange(bool fEnabled); 77 78 /** Notifies about the scale-factor change. */ 79 void sigScaleFactorChange(const QString &strMachineID); 77 80 78 81 #ifdef RT_OS_DARWIN -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp
r53372 r53389 764 764 #endif /* VBOX_WITH_VIDEOHWACCEL */ 765 765 766 void UIFrameBuffer::sltHandleScaleFactorChange(const QString &strMachineID) 767 { 768 /* Skip unrelated machine IDs: */ 769 if (strMachineID != vboxGlobal().managedVMUuid()) 770 return; 771 772 /* Fetch new scale-factor: */ 773 m_dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 774 } 775 766 776 void UIFrameBuffer::prepareConnections() 767 777 { 778 /* EMT connections: */ 768 779 connect(this, SIGNAL(sigNotifyChange(int, int)), 769 780 m_pMachineView, SLOT(sltHandleNotifyChange(int, int)), … … 778 789 m_pMachineView, SLOT(sltHandle3DOverlayVisibilityChange(bool)), 779 790 Qt::QueuedConnection); 791 792 /* Extra-data manager connections: */ 793 connect(gEDataManager, SIGNAL(sigScaleFactorChange(const QString&)), 794 this, SLOT(sltHandleScaleFactorChange(const QString&))); 780 795 } 781 796 782 797 void UIFrameBuffer::cleanupConnections() 783 798 { 799 /* EMT connections: */ 784 800 disconnect(this, SIGNAL(sigNotifyChange(int, int)), 785 801 m_pMachineView, SLOT(sltHandleNotifyChange(int, int))); … … 790 806 disconnect(this, SIGNAL(sigNotifyAbout3DOverlayVisibilityChange(bool)), 791 807 m_pMachineView, SLOT(sltHandle3DOverlayVisibilityChange(bool))); 808 809 /* Extra-data manager connections: */ 810 disconnect(gEDataManager, SIGNAL(sigScaleFactorChange(const QString&)), 811 this, SLOT(sltHandleScaleFactorChange(const QString&))); 792 812 } 793 813 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h
r53372 r53389 223 223 void setBackingScaleFactor(double dBackingScaleFactor) { m_dBackingScaleFactor = dBackingScaleFactor; } 224 224 225 protected slots: 226 227 /** Handles the scale-factor change. */ 228 void sltHandleScaleFactorChange(const QString &strMachineID); 229 225 230 protected: 226 231 … … 278 283 * @{ */ 279 284 /** Holds the scale-factor used by the scaled-size. */ 280 constdouble m_dScaleFactor;285 double m_dScaleFactor; 281 286 /** Holds the frame-buffer's scaled-size. */ 282 287 QSize m_scaledSize; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r53388 r53389 316 316 { 317 317 setMaxGuestSize(); 318 } 319 320 void UIMachineView::sltHandleScaleFactorChange(const QString &strMachineID) 321 { 322 /* Skip unrelated machine IDs: */ 323 if (strMachineID != vboxGlobal().managedVMUuid()) 324 return; 325 326 /* Adjust frame-buffer, machine-window and guest-screen size if necessary: */ 327 sltHandleNotifyChange(frameBuffer()->width(), frameBuffer()->height()); 328 machineWindow()->normalizeGeometry(true /* adjust position */); 329 adjustGuestScreenSize(); 318 330 } 319 331 … … 540 552 connect(QApplication::desktop(), SIGNAL(resized(int)), this, 541 553 SLOT(sltDesktopResized())); 554 /* Scale-factor change: */ 555 connect(gEDataManager, SIGNAL(sigScaleFactorChange(const QString&)), 556 this, SLOT(sltHandleScaleFactorChange(const QString&))); 542 557 } 543 558 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
r53372 r53389 113 113 /* Watch dog for desktop resizes: */ 114 114 void sltDesktopResized(); 115 116 /** Handles the scale-factor change. */ 117 void sltHandleScaleFactorChange(const QString &strMachineID); 115 118 116 119 /* Console callback handlers: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp
r52730 r53389 37 37 # include "UIMachineViewFullscreen.h" 38 38 # include "UIFrameBuffer.h" 39 # include "UIExtraDataManager.h" 39 40 40 41 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ … … 144 145 void UIMachineViewFullscreen::adjustGuestScreenSize() 145 146 { 147 /* Acquire working-area size: */ 148 const QSize workingAreaSize = workingArea().size(); 149 /* Acquire frame-buffer size: */ 150 QSize frameBufferSize(frameBuffer()->width(), frameBuffer()->height()); 151 /* Take the scale-factor into account: */ 152 frameBufferSize *= gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 146 153 /* Check if we should adjust guest-screen to new size: */ 147 154 if (frameBuffer()->isAutoEnabled() || 148 (int)frameBuffer()->width() != workingArea().size().width() || 149 (int)frameBuffer()->height() != workingArea().size().height()) 155 frameBufferSize != workingAreaSize) 150 156 if (m_bIsGuestAutoresizeEnabled && 151 157 uisession()->isGuestSupportsGraphics() && -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp
r52730 r53389 168 168 void UIMachineViewNormal::adjustGuestScreenSize() 169 169 { 170 /* Acquire central-widget size: */ 171 const QSize centralWidgetSize = machineWindow()->centralWidget()->size(); 172 /* Acquire frame-buffer size: */ 173 QSize frameBufferSize(frameBuffer()->width(), frameBuffer()->height()); 174 /* Take the scale-factor into account: */ 175 frameBufferSize *= gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 170 176 /* Check if we should adjust guest-screen to new size: */ 171 const QSize centralWidgetSize = machineWindow()->centralWidget()->size(); 172 if ((int)frameBuffer()->width() != centralWidgetSize.width() || 173 (int)frameBuffer()->height() != centralWidgetSize.height()) 177 if (frameBufferSize != centralWidgetSize) 174 178 if (m_bIsGuestAutoresizeEnabled && uisession()->isGuestSupportsGraphics()) 175 179 sltPerformGuestResize(centralWidgetSize); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp
r53076 r53389 36 36 # include "UIMachineViewSeamless.h" 37 37 # include "UIFrameBuffer.h" 38 # include "UIExtraDataManager.h" 38 39 39 40 /* COM includes: */ … … 161 162 void UIMachineViewSeamless::adjustGuestScreenSize() 162 163 { 164 /* Acquire working-area size: */ 165 const QSize workingAreaSize = workingArea().size(); 166 /* Acquire frame-buffer size: */ 167 QSize frameBufferSize(frameBuffer()->width(), frameBuffer()->height()); 168 /* Take the scale-factor into account: */ 169 frameBufferSize *= gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 163 170 /* Check if we should adjust guest-screen to new size: */ 164 171 if (frameBuffer()->isAutoEnabled() || 165 (int)frameBuffer()->width() != workingArea().size().width() || 166 (int)frameBuffer()->height() != workingArea().size().height()) 172 frameBufferSize != workingAreaSize) 167 173 if (uisession()->isGuestSupportsGraphics() && 168 174 uisession()->isScreenVisible(screenId()))
Note:
See TracChangeset
for help on using the changeset viewer.