Changeset 32407 in vbox
- Timestamp:
- Sep 10, 2010 1:39:19 PM (14 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r31341 r32407 162 162 break; 163 163 } 164 #ifdef VBOX_TEST_IMAGE_ON_RESTORE165 164 case KMachineState_Restoring: 166 165 { … … 174 173 break; 175 174 } 176 #endif177 175 case KMachineState_Running: 178 176 { … … 384 382 } 385 383 386 #ifdef VBOX_TEST_IMAGE_ON_RESTORE387 384 QSize size; 388 385 #ifdef Q_WS_X11 … … 399 396 machine.QuerySavedScreenshotPNGSize(0, buffer, width, height); 400 397 if (buffer > 0) 401 size = guestSizeHint(); 398 { 399 /* Init with the screenshot size */ 400 size = QSize(width, height); 401 /* Try to get the real guest dimensions from the save state */ 402 ULONG guestWidth = 0, guestHeight = 0; 403 machine.QuerySavedGuestSize(0, guestWidth, guestHeight); 404 if ( guestWidth > 0 405 && guestHeight > 0) 406 size = QSize(guestWidth, guestHeight); 407 } 402 408 /* If we have a valid size, resize the framebuffer. */ 403 409 if ( size.width() > 0 … … 407 413 frameBuffer()->resizeEvent(&event); 408 414 } 409 #else410 #ifdef Q_WS_X11411 /* Processing pseudo resize-event to synchronize frame-buffer412 * with stored framebuffer size in case of machine state was 'saved': */413 if (session().GetMachine().GetState() == KMachineState_Saved)414 {415 QSize size = guestSizeHint();416 UIResizeEvent event(FramebufferPixelFormat_Opaque, NULL, 0, 0, size.width(), size.height());417 frameBuffer()->resizeEvent(&event);418 }419 #endif /* Q_WS_X11 */420 #endif421 415 } 422 416 … … 684 678 if (screenData.size() != 0) 685 679 { 686 QImage shot = QImage::fromData(screenData.data(), screenData.size(), "PNG").scaled(guestSizeHint()); 680 ULONG guestWidth = 0, guestHeight = 0; 681 machine.QuerySavedGuestSize(0, guestWidth, guestHeight); 682 QImage shot = QImage::fromData(screenData.data(), screenData.size(), "PNG").scaled(guestWidth > 0 ? QSize(guestWidth, guestHeight) : guestSizeHint()); 687 683 dimImage(shot); 688 684 m_pauseShot = QPixmap::fromImage(shot); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp
r32174 r32407 102 102 if (screenData.size() != 0) 103 103 { 104 QImage shot = QImage::fromData(screenData.data(), screenData.size(), "PNG").scaled(guestSizeHint()); 104 ULONG guestWidth = 0, guestHeight = 0; 105 machine.QuerySavedGuestSize(0, guestWidth, guestHeight); 106 QImage shot = QImage::fromData(screenData.data(), screenData.size(), "PNG").scaled(guestWidth > 0 ? QSize(guestWidth, guestHeight) : guestSizeHint()); 105 107 m_pPauseImage = new QImage(shot); 106 108 scalePauseShot(); … … 127 129 if (scaledSize.isValid()) 128 130 { 129 QImage tmpImg = m_pPauseImage->scaled( frameBuffer()->scaledSize(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);131 QImage tmpImg = m_pPauseImage->scaled(scaledSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); 130 132 dimImage(tmpImg); 131 133 m_pauseShot = QPixmap::fromImage(tmpImg); … … 238 240 qobject_cast<QMainWindow*>(machineWindowWrapper()->machineWindow()) : 0; 239 241 240 if (pWatched != 0 && pWatched == pMainDialog)242 if (pWatched != 0 && pWatched == viewport()) 241 243 { 242 244 switch (pEvent->type()) … … 248 250 break; 249 251 } 252 default: 253 break; 254 } 255 } 256 else if (pWatched != 0 && pWatched == pMainDialog) 257 { 258 switch (pEvent->type()) 259 { 250 260 #if defined (Q_WS_WIN32) 251 261 # if defined (VBOX_GUI_USE_DDRAW) … … 307 317 } 308 318 309 #ifdef VBOX_TEST_IMAGE_ON_RESTORE310 319 QSize size; 311 320 #ifdef Q_WS_X11 … … 322 331 machine.QuerySavedScreenshotPNGSize(0, buffer, width, height); 323 332 if (buffer > 0) 324 size = guestSizeHint(); 333 { 334 /* Init with the screenshot size */ 335 size = QSize(width, height); 336 /* Try to get the real guest dimensions from the save state */ 337 ULONG guestWidth = 0, guestHeight = 0; 338 machine.QuerySavedGuestSize(0, guestWidth, guestHeight); 339 if ( guestWidth > 0 340 && guestHeight > 0) 341 size = QSize(guestWidth, guestHeight); 342 } 325 343 /* If we have a valid size, resize the framebuffer. */ 326 344 if ( size.width() > 0 … … 329 347 UIResizeEvent event(FramebufferPixelFormat_Opaque, NULL, 0, 0, size.width(), size.height()); 330 348 frameBuffer()->resizeEvent(&event); 331 QTimer::singleShot(0, this, SLOT(sltPerformGuestScale())); 332 } 333 #endif 349 } 334 350 } 335 351
Note:
See TracChangeset
for help on using the changeset viewer.