Changeset 57495 in vbox
- Timestamp:
- Aug 21, 2015 12:50:43 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r57080 r57495 280 280 /* Assign new frame-buffer logical-size: */ 281 281 frameBuffer()->setScaledSize(size()); 282 283 /* Forget the last full-screen size: */ 284 uisession()->setLastFullScreenSize(screenId(), QSize(-1, -1)); 282 285 } 283 286 /* For other than 'scale' mode: */ … … 287 290 setMaximumSize(sizeHint()); 288 291 289 /* Disable the resize hint override hack : */292 /* Disable the resize hint override hack and forget the last full-screen size: */ 290 293 m_sizeHintOverride = QSize(-1, -1); 294 if (visualStateType() == UIVisualStateType_Normal) 295 uisession()->setLastFullScreenSize(screenId(), QSize(-1, -1)); 291 296 292 297 /* Force machine-window update own layout: */ … … 843 848 QSize UIMachineView::sizeHint() const 844 849 { 845 if (m_sizeHintOverride.isValid() && uisession()->isGuestSupportsGraphics()) 850 /* Temporarily restrict the size to prevent a brief resize to the 851 * frame-buffer dimensions when we exit full-screen. This is only 852 * applied if the frame-buffer is at full-screen dimensions and 853 * until the first machine view resize. */ 854 855 /* Get the frame-buffer dimensions: */ 856 QSize frameBufferSize(frameBuffer()->width(), frameBuffer()->height()); 857 /* Take the scale-factor(s) into account: */ 858 frameBufferSize = scaledForward(frameBufferSize); 859 /* Check against the last full-screen size. */ 860 if (frameBufferSize == uisession()->lastFullScreenSize(screenId()) && m_sizeHintOverride.isValid()) 846 861 return m_sizeHintOverride; 847 862 … … 977 992 /* Adjust maximum-size restriction for machine-view: */ 978 993 setMaximumSize(sizeHint()); 979 980 /* Disable the resize hint override hack: */981 m_sizeHintOverride = QSize(-1, -1);982 994 983 995 /* Force machine-window update own layout: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r57285 r57495 1243 1243 m_monitorVisibilityVector[0] = true; 1244 1244 1245 /* Prepare empty last full-screen size vector: */ 1246 m_monitorLastFullScreenSizeVector.resize(machine().GetMonitorCount()); 1247 m_monitorLastFullScreenSizeVector.fill(QSize(-1, -1)); 1248 1245 1249 /* If machine is in 'saved' state: */ 1246 1250 if (isSaved()) … … 1925 1929 } 1926 1930 1931 QSize UISession::lastFullScreenSize(ulong uScreenId) const 1932 { 1933 /* Make sure index fits the bounds: */ 1934 AssertReturn(uScreenId < (ulong)m_monitorLastFullScreenSizeVector.size(), QSize(-1, -1)); 1935 1936 /* Return last full-screen size: */ 1937 return m_monitorLastFullScreenSizeVector.value((int)uScreenId); 1938 } 1939 1940 void UISession::setLastFullScreenSize(ulong uScreenId, QSize size) 1941 { 1942 /* Make sure index fits the bounds: */ 1943 AssertReturnVoid(uScreenId < (ulong)m_monitorLastFullScreenSizeVector.size()); 1944 1945 /* Remember last full-screen size: */ 1946 m_monitorLastFullScreenSizeVector[(int)uScreenId] = size; 1947 } 1948 1927 1949 int UISession::countOfVisibleWindows() 1928 1950 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r57178 r57495 227 227 void setScreenVisible(ulong uScreenId, bool fIsMonitorVisible); 228 228 229 /* Last screen full-screen size: */ 230 QSize lastFullScreenSize(ulong uScreenId) const; 231 void setLastFullScreenSize(ulong uScreenId, QSize size); 232 229 233 /* Returns existing framebuffer for the given screen-number; 230 234 * Returns 0 (asserts) if screen-number attribute is out of bounds: */ … … 407 411 QVector<bool> m_monitorVisibilityVector; 408 412 413 /* Screen last full-screen size vector: */ 414 QVector<QSize> m_monitorLastFullScreenSizeVector; 415 409 416 /* Frame-buffers vector: */ 410 417 QVector<UIFrameBuffer*> m_frameBufferVector; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp
r57483 r57495 209 209 frameBuffer()->setAutoEnabled(false); 210 210 sltPerformGuestResize(workingArea().size()); 211 /* And remember the size to know what we are resizing out of when we exit: */ 212 uisession()->setLastFullScreenSize(screenId(), workingArea().size()); 211 213 } 212 214 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp
r57285 r57495 145 145 setMaxGuestSize(sizeHint); 146 146 147 if (uisession()->isGuestSupportsGraphics()) 148 { 149 /* Temporarily restrict the size to prevent a brief resize to the 150 * framebuffer dimensions (see @a UIMachineView::sizeHint()) before 151 * the following resize() is acted upon. Expand current limitations 152 * too. */ 153 setMaximumSize(sizeHint); 154 m_sizeHintOverride = sizeHint; 155 } 147 /* Temporarily restrict the size to prevent a brief resize to the 148 * frame-buffer dimensions when we exit full-screen. This is only 149 * applied if the frame-buffer is at full-screen dimensions and 150 * until the first machine view resize. */ 151 m_sizeHintOverride = QSize(800, 600).expandedTo(sizeHint); 156 152 157 153 /* Send saved size-hint to the guest: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp
r57483 r57495 217 217 frameBuffer()->setAutoEnabled(false); 218 218 sltPerformGuestResize(workingArea().size()); 219 /* And remember the size to know what we are resizing out of when we exit: */ 220 uisession()->setLastFullScreenSize(screenId(), workingArea().size()); 219 221 } 220 222 }
Note:
See TracChangeset
for help on using the changeset viewer.