- Timestamp:
- Jun 30, 2015 2:58:12 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r56217 r56701 3072 3072 } 3073 3073 3074 QSize UIExtraDataManager::lastGuestS izeHint(ulong uScreenIndex, const QString &strID)3074 QSize UIExtraDataManager::lastGuestScreenSizeHint(ulong uScreenIndex, const QString &strID) 3075 3075 { 3076 3076 /* Choose corresponding key: */ … … 3096 3096 } 3097 3097 3098 void UIExtraDataManager::setLastGuestS izeHint(ulong uScreenIndex, const QSize &sizeHint, const QString &strID)3098 void UIExtraDataManager::setLastGuestScreenSizeHint(ulong uScreenIndex, const QSize &sizeHint, const QString &strID) 3099 3099 { 3100 3100 /* Choose corresponding key: */ -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r55939 r56701 380 380 381 381 /** Returns last guest-screen size-hint for screen with @a uScreenIndex. */ 382 QSize lastGuestS izeHint(ulong uScreenIndex, const QString &strID);382 QSize lastGuestScreenSizeHint(ulong uScreenIndex, const QString &strID); 383 383 /** Defines last guest-screen @a sizeHint for screen with @a uScreenIndex. */ 384 void setLastGuestS izeHint(ulong uScreenIndex, const QSize &sizeHint, const QString &strID);384 void setLastGuestScreenSizeHint(ulong uScreenIndex, const QSize &sizeHint, const QString &strID); 385 385 386 386 /** Returns host-screen index corresponding to passed guest-screen @a iGuestScreenIndex. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r56617 r56701 659 659 * On X11 this will be additional done when the machine state was 'saved'. */ 660 660 if (machine().GetState() == KMachineState_Saved) 661 size = guestS izeHint();661 size = guestScreenSizeHint(); 662 662 #endif /* Q_WS_X11 */ 663 663 … … 923 923 } 924 924 925 QSize UIMachineView::guestS izeHint()925 QSize UIMachineView::guestScreenSizeHint() const 926 926 { 927 927 /* Load guest-screen size-hint: */ 928 QSize size = gEDataManager->lastGuestSizeHint(m_uScreenId, vboxGlobal().managedVMUuid());928 QSize sizeHint = gEDataManager->lastGuestScreenSizeHint(m_uScreenId, vboxGlobal().managedVMUuid()); 929 929 930 930 /* Invent the default if necessary: */ 931 if (!size .isValid())932 size = QSize(800, 600);931 if (!sizeHint.isValid()) 932 sizeHint = QSize(800, 600); 933 933 934 934 /* Take the scale-factor(s) into account: */ 935 size = scaledForward(size); 936 937 /* Return size: */ 938 return size; 935 sizeHint = scaledForward(sizeHint); 936 937 /* Return size-hint: */ 938 return sizeHint; 939 } 940 941 void UIMachineView::storeGuestSizeHint(const QSize &sizeHint) 942 { 943 /* Save guest-screen size-hint: */ 944 LogRel(("GUI: UIMachineView::storeGuestSizeHint: " 945 "Storing guest-screen size-hint for screen %d as %dx%d\n", 946 (int)screenId(), sizeHint.width(), sizeHint.height())); 947 gEDataManager->setLastGuestScreenSizeHint(m_uScreenId, sizeHint, vboxGlobal().managedVMUuid()); 939 948 } 940 949 … … 983 992 LogRelFlow(("GUI: UIMachineView::handleScaleChange: Complete for Screen=%d\n", 984 993 (unsigned long)m_uScreenId)); 985 }986 987 void UIMachineView::storeGuestSizeHint(const QSize &size)988 {989 /* Save guest-screen size-hint: */990 LogRel(("GUI: UIMachineView::storeGuestSizeHint: "991 "Storing guest size-hint for screen %d as %dx%d\n",992 (int)screenId(), size.width(), size.height()));993 gEDataManager->setLastGuestSizeHint(m_uScreenId, size, vboxGlobal().managedVMUuid());994 994 } 995 995 … … 1059 1059 1060 1060 /* Create a screen-shot on the basis of the screen-data we have in saved-state: */ 1061 QImage screenShot = QImage::fromData(screenData.data(), screenData.size(), "PNG").scaled(uGuestWidth > 0 ? QSize(uGuestWidth, uGuestHeight) : guestS izeHint());1061 QImage screenShot = QImage::fromData(screenData.data(), screenData.size(), "PNG").scaled(uGuestWidth > 0 ? QSize(uGuestWidth, uGuestHeight) : guestScreenSizeHint()); 1062 1062 1063 1063 /* Dim screen-shot if it is Ok: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
r56497 r56701 209 209 * @sa m_u64MaxGuestSize. */ 210 210 QSize maxGuestSize(); 211 /** Retrieve the last non-fullscreen guest size hint (from extra data). 212 */ 213 QSize guestSizeHint(); 211 212 /** Retrieves the last guest-screen size-hint from extra-data. */ 213 QSize guestScreenSizeHint() const; 214 /** Stores a guest-screen size-hint to extra-data. */ 215 void storeGuestSizeHint(const QSize &sizeHint); 214 216 215 217 /** Handles machine-view scale changes. */ 216 218 void handleScaleChange(); 217 218 /* Protected setters: */219 /** Store a guest size hint value to extra data, called on switching to220 * fullscreen. */221 void storeGuestSizeHint(const QSize &size);222 219 223 220 /** Returns the pause-pixmap: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp
r56561 r56701 137 137 void UIMachineViewNormal::resendSizeHint() 138 138 { 139 /* Get the last sizehint, taking the scale factor into account. */140 const QSize sizeHint = scaledBackward(guestS izeHint());139 /* Get the last guest-screen size-hint, taking the scale factor into account. */ 140 const QSize sizeHint = scaledBackward(guestScreenSizeHint()); 141 141 LogRel(("GUI: UIMachineViewNormal::resendSizeHint: Restoring guest size-hint for screen %d to %dx%d\n", 142 142 (int)screenId(), sizeHint.width(), sizeHint.height())); 143 144 /* Expand current limitations: */ 145 setMaxGuestSize(sizeHint); 146 143 147 if (uisession()->isGuestSupportsGraphics()) 144 148 { … … 150 154 m_sizeHintOverride = sizeHint; 151 155 } 152 /** @todo What if not m_bIsGuestAutoresizeEnabled? Just let the guest start 153 * at the default 800x600? */ 154 display().SetVideoModeHint(screenId(), true, false, 0, 0, sizeHint.width(), sizeHint.height(), 0); 156 157 /* Send saved size-hint to the guest: */ 158 /// @todo What if not m_bIsGuestAutoresizeEnabled? 159 /// Just let the guest start at the default 800x600? 160 display().SetVideoModeHint(screenId(), 161 true /* temporary decision */, 162 false, 0, 0, sizeHint.width(), sizeHint.height(), 0); 155 163 } 156 164 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp
r56443 r56701 153 153 void UIMachineViewScale::resendSizeHint() 154 154 { 155 const QSize sizeHint = scaledBackward(guestSizeHint()); 155 /* Get the last guest-screen size-hint, taking the scale factor into account. */ 156 const QSize sizeHint = scaledBackward(guestScreenSizeHint()); 156 157 LogRel(("GUI: UIMachineViewScale::resendSizeHint: Restoring guest size-hint for screen %d to %dx%d\n", 157 158 (int)screenId(), sizeHint.width(), sizeHint.height())); 159 158 160 /* Expand current limitations: */ 159 161 setMaxGuestSize(sizeHint); 160 display().SetVideoModeHint(screenId(), true, false, 0, 0, sizeHint.width(), sizeHint.height(), 0); 162 163 /* Send saved size-hint to the guest: */ 164 display().SetVideoModeHint(screenId(), 165 true /* temporary decision */, 166 false, 0, 0, sizeHint.width(), sizeHint.height(), 0); 161 167 } 162 168
Note:
See TracChangeset
for help on using the changeset viewer.