- Timestamp:
- Mar 13, 2023 4:49:03 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 156284
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r98841 r98943 1189 1189 void UIMachineView::prepareFrameBuffer() 1190 1190 { 1191 /* Make sure frame-buffer exists: */ 1192 if (!frameBuffer()) 1193 return; 1194 1191 1195 /* If frame-buffer NOT yet initialized: */ 1192 1196 if (!frameBuffer()->isInitialized()) … … 1398 1402 QSize UIMachineView::sizeHint() const 1399 1403 { 1400 /* Temporarily restrict the size to prevent a brief resize to the 1401 * frame-buffer dimensions when we exit full-screen. This is only 1402 * applied if the frame-buffer is at full-screen dimensions and 1403 * until the first machine view resize. */ 1404 1405 /* Get the frame-buffer dimensions: */ 1406 QSize frameBufferSize(frameBuffer()->width(), frameBuffer()->height()); 1407 /* Take the scale-factor(s) into account: */ 1408 frameBufferSize = scaledForward(frameBufferSize); 1409 /* Check against the last full-screen size. */ 1410 if (frameBufferSize == uimachine()->lastFullScreenSize(screenId()) && m_sizeHintOverride.isValid()) 1411 return m_sizeHintOverride; 1412 1413 /* Get frame-buffer size-hint: */ 1414 QSize size(frameBuffer()->width(), frameBuffer()->height()); 1415 1416 /* Take the scale-factor(s) into account: */ 1417 size = scaledForward(size); 1404 /* Make sure frame-buffer exists: */ 1405 QSize size; 1406 if (!frameBuffer()) 1407 size = QSize(640, 480); 1408 else 1409 { 1410 // WORKAROUND: 1411 // Temporarily restrict the size to prevent a brief resize to the frame-buffer dimensions when 1412 // we exit full-screen. This is only applied if the frame-buffer is at full-screen dimensions 1413 // and until the first machine view resize. 1414 /* Get the frame-buffer dimensions: */ 1415 QSize frameBufferSize(frameBuffer()->width(), frameBuffer()->height()); 1416 /* Take the scale-factor(s) into account: */ 1417 frameBufferSize = scaledForward(frameBufferSize); 1418 /* Check against the last full-screen size: */ 1419 if (frameBufferSize == uimachine()->lastFullScreenSize(screenId()) && m_sizeHintOverride.isValid()) 1420 return m_sizeHintOverride; 1421 1422 /* Get frame-buffer size-hint: */ 1423 size = QSize(frameBuffer()->width(), frameBuffer()->height()); 1424 /* Take the scale-factor(s) into account: */ 1425 size = scaledForward(size); 1418 1426 1419 1427 #ifdef VBOX_WITH_DEBUGGER_GUI 1420 /// @todo Fix all DEBUGGER stuff! 1421 /* HACK ALERT! Really ugly workaround for the resizing to 9x1 done by DevVGA if provoked before power on. */ 1422 if (size.width() < 16 || size.height() < 16) 1423 if (uiCommon().shouldStartPaused() || uiCommon().isDebuggerAutoShowEnabled()) 1424 size = QSize(640, 480); 1425 #endif /* !VBOX_WITH_DEBUGGER_GUI */ 1428 /// @todo Fix all DEBUGGER stuff! 1429 // WORKAROUND: 1430 // Really ugly workaround for the resizing to 9x1 1431 // done by DevVGA if provoked before power on. 1432 if (size.width() < 16 || size.height() < 16) 1433 if (uiCommon().shouldStartPaused() || uiCommon().isDebuggerAutoShowEnabled()) 1434 size = QSize(640, 480); 1435 #endif /* VBOX_WITH_DEBUGGER_GUI */ 1436 } 1426 1437 1427 1438 /* Return the resulting size-hint: */ … … 1637 1648 void UIMachineView::updateSliders() 1638 1649 { 1650 /* Make sure framebuffer still present: */ 1651 if (!frameBuffer()) 1652 return; 1653 1639 1654 /* Get current viewport size: */ 1640 1655 QSize curViewportSize = viewport()->size();
Note:
See TracChangeset
for help on using the changeset viewer.