Changeset 98688 in vbox
- Timestamp:
- Feb 22, 2023 2:55:12 PM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r98683 r98688 1266 1266 QSize size; 1267 1267 { 1268 /* Acquire actual machine state to be sure: */ 1269 KMachineState enmActualState = KMachineState_Null; 1270 uimachine()->acquireLiveMachineState(enmActualState); 1271 1268 1272 #ifdef VBOX_WS_X11 1269 1273 // WORKAROUND: 1270 // Processing pseudo resize-event to synchronize frame-buffer with stored framebuffer size. 1271 // On X11 this have to be additionally done when the machine state was 'saved'. 1272 KMachineState enmActualState = KMachineState_Null; 1273 uimachine()->acquireLiveMachineState(enmActualState); 1274 // No idea why this was required for X11 before. 1275 // Currently I don't see a reason why I should keep it. 1276 # if 0 1274 1277 if (enmActualState == KMachineState_Saved || enmActualState == KMachineState_AbortedSaved) 1275 1278 size = storedGuestScreenSizeHint(); 1279 # endif 1276 1280 #endif /* VBOX_WS_X11 */ 1277 1281 1278 /* If there is a preview image saved, 1279 * we will resize the framebuffer to the size of that image: */ 1280 ULONG uWidth = 0, uHeight = 0; 1281 QVector<KBitmapFormat> formats = machine().QuerySavedScreenshotInfo(0, uWidth, uHeight); 1282 if (formats.size() > 0) 1283 { 1284 /* Init with the screenshot size: */ 1285 size = QSize(uWidth, uHeight); 1286 /* Try to get the real guest dimensions from the save-state: */ 1287 ULONG uGuestOriginX = 0, uGuestOriginY = 0, uGuestWidth = 0, uGuestHeight = 0; 1288 BOOL fEnabled = true; 1289 machine().QuerySavedGuestScreenInfo(m_uScreenId, uGuestOriginX, uGuestOriginY, uGuestWidth, uGuestHeight, fEnabled); 1290 if (uGuestWidth > 0 && uGuestHeight > 0) 1291 size = QSize(uGuestWidth, uGuestHeight); 1282 /* If there is a preview image saved, we will resize the framebuffer to the size of that image: */ 1283 if (enmActualState == KMachineState_Saved || enmActualState == KMachineState_AbortedSaved) 1284 { 1285 ULONG uWidth = 0, uHeight = 0; 1286 QVector<KBitmapFormat> formats = machine().QuerySavedScreenshotInfo(0, uWidth, uHeight); 1287 if (formats.size() > 0) 1288 { 1289 /* Init with the screenshot size: */ 1290 size = QSize(uWidth, uHeight); 1291 /* Try to get the real guest dimensions from the save-state: */ 1292 ULONG uGuestOriginX = 0, uGuestOriginY = 0, uGuestWidth = 0, uGuestHeight = 0; 1293 BOOL fEnabled = true; 1294 machine().QuerySavedGuestScreenInfo(m_uScreenId, uGuestOriginX, uGuestOriginY, uGuestWidth, uGuestHeight, fEnabled); 1295 if (uGuestWidth > 0 && uGuestHeight > 0) 1296 size = QSize(uGuestWidth, uGuestHeight); 1297 } 1292 1298 } 1293 1299
Note:
See TracChangeset
for help on using the changeset viewer.