Changeset 52246 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 31, 2014 12:09:47 PM (10 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r52202 r52246 181 181 182 182 /* Send new size-hint to the guest: */ 183 LogRelFlow(("UIMachineView: Sending guest size-hint to screen %d: %dx%d\n", 184 (int)screenId(), newSize.width(), newSize.height())); 183 LogRel(("UIMachineView::sltPerformGuestResize: " 184 "Sending guest size-hint to screen %d as %dx%d\n", 185 (int)screenId(), newSize.width(), newSize.height())); 185 186 session().GetConsole().GetDisplay().SetVideoModeHint(screenId(), 186 187 uisession()->isScreenVisible(screenId()), … … 654 655 { 655 656 /* Save guest-screen size-hint: */ 657 LogRel(("UIMachineView::storeGuestSizeHint: " 658 "Storing guest size-hint for screen %d as %dx%d\n", 659 (int)screenId(), size.width(), size.height())); 656 660 gEDataManager->setLastGuestSizeHint(m_uScreenId, size, vboxGlobal().managedVMUuid()); 657 661 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp
r52202 r52246 50 50 , m_bIsGuestAutoresizeEnabled(actionPool()->action(UIActionIndexRT_M_View_T_GuestAutoresize)->isChecked()) 51 51 { 52 /* Resend the last resize hint if there was a fullscreen or 53 * seamless transition previously. If we were not in graphical 54 * mode initially after the transition this happens when we switch. */ 55 maybeResendResizeHint(); 52 /* Resend the last resize hint if necessary: */ 53 maybeResendSizeHint(); 56 54 } 57 55 … … 146 144 void UIMachineViewNormal::saveMachineViewSettings() 147 145 { 148 /* Store guest size in case we are switching to fullscreen: */ 149 storeGuestSizeHint(QSize(frameBuffer()->width(), frameBuffer()->height())); 146 /* If guest screen-still visible => store it's size-hint: */ 147 if (uisession()->isScreenVisible(screenId())) 148 storeGuestSizeHint(QSize(frameBuffer()->width(), frameBuffer()->height())); 150 149 } 151 150 … … 161 160 } 162 161 163 /** 164 * Resends guest size-hint if necessary. 165 * If the last guest size hint was sent to switch to 166 * fullscreen or seamless mode then send one to restore the old view size. 167 * @note This method also does some hacks to suppress intermediary resizes 168 * to the old fullscreen size. 169 */ 170 void UIMachineViewNormal::maybeResendResizeHint() 162 void UIMachineViewNormal::maybeResendSizeHint() 171 163 { 172 164 if (m_bIsGuestAutoresizeEnabled && uisession()->isGuestSupportsGraphics()) … … 175 167 if (gEDataManager->wasLastGuestSizeHintForFullScreen(m_uScreenId, vboxGlobal().managedVMUuid())) 176 168 { 177 QSize hint = guestSizeHint(); 169 const QSize sizeHint = guestSizeHint(); 170 LogRel(("UIMachineViewNormal::maybeResendSizeHint: " 171 "Restoring guest size-hint for screen %d to %dx%d\n", 172 (int)screenId(), sizeHint.width(), sizeHint.height())); 178 173 /* Temporarily restrict the size to prevent a brief resize to the 179 174 * framebuffer dimensions (see @a UIMachineView::sizeHint()) before 180 175 * the following resize() is acted upon. */ 181 setMaximumSize( hint);182 m_sizeHintOverride = hint;183 sltPerformGuestResize( hint);176 setMaximumSize(sizeHint); 177 m_sizeHintOverride = sizeHint; 178 sltPerformGuestResize(sizeHint); 184 179 } 185 180 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.h
r49177 r52246 64 64 void setGuestAutoresizeEnabled(bool bEnabled); 65 65 66 /** Resends guest size-hint if necessary. */ 67 void maybeResendSizeHint(); 68 66 69 /* Private helpers: */ 67 void maybeResendResizeHint();68 70 void maybeAdjustGuestScreenSize(); 69 71 QRect workingArea() const; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp
r52200 r52246 29 29 #include "UIMachineWindow.h" 30 30 #include "UIMachineViewScale.h" 31 #include "UIExtraDataManager.h" 31 32 #include "UIFrameBuffer.h" 32 33 … … 49 50 , m_pPauseImage(0) 50 51 { 52 /* Resend the last resize hint if necessary: */ 53 maybeResendSizeHint(); 51 54 } 52 55 … … 174 177 void UIMachineViewScale::saveMachineViewSettings() 175 178 { 176 /* Store guest size in case we are switching to fullscreen: */ 177 storeGuestSizeHint(QSize(frameBuffer()->width(), frameBuffer()->height())); 179 /* If guest screen-still visible => store it's size-hint: */ 180 if (uisession()->isScreenVisible(screenId())) 181 storeGuestSizeHint(QSize(frameBuffer()->width(), frameBuffer()->height())); 182 } 183 184 void UIMachineViewScale::maybeResendSizeHint() 185 { 186 if (uisession()->isGuestSupportsGraphics()) 187 { 188 /* Send guest-screen size-hint if needed to reverse a transition to fullscreen or seamless: */ 189 if (gEDataManager->wasLastGuestSizeHintForFullScreen(m_uScreenId, vboxGlobal().managedVMUuid())) 190 { 191 const QSize sizeHint = guestSizeHint(); 192 LogRel(("UIMachineViewScale::maybeResendSizeHint: " 193 "Restoring guest size-hint for screen %d to %dx%d\n", 194 (int)screenId(), sizeHint.width(), sizeHint.height())); 195 sltPerformGuestResize(sizeHint); 196 } 197 } 178 198 } 179 199 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.h
r49177 r52246 63 63 void saveMachineViewSettings(); 64 64 65 /** Resends guest size-hint if necessary. */ 66 void maybeResendSizeHint(); 67 65 68 /* Private helpers: */ 66 69 QSize sizeHint() const;
Note:
See TracChangeset
for help on using the changeset viewer.