Changeset 7322 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Mar 6, 2008 2:10:52 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 28738
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
r7319 r7322 2858 2858 } 2859 2859 } 2860 else if (mLastState == KMachineState_Starting) 2861 { 2862 /* Suggest an initial size. */ 2863 sendInitialSizeHint (); 2864 } 2860 2865 /* reuse the focus event handler to capture input */ 2861 2866 if (hasFocus()) … … 3565 3570 } 3566 3571 3572 3573 /** 3574 * We send an initial size hint to the VM on startup, so that it can choose 3575 * an initial size which is well-readable on the host screen. 3576 */ 3577 void VBoxConsoleView::sendInitialSizeHint(void) 3578 { 3579 enum { NUM_RES = 4 }; 3580 3581 const int sizeList[NUM_RES][2] = 3582 { 3583 { 640, 480 }, 3584 { 800, 600 }, 3585 { 1024, 768 }, 3586 { 1280, 960 } 3587 }; 3588 /** @todo save the last resize hint sent before a VM shutdown in 3589 the XML and send that on next startup. */ 3590 QRect screen = QApplication::desktop()->screenGeometry (this); 3591 unsigned i = 0; 3592 /* Find a size that is smaller than three quarters of the reported 3593 screen geometry. */ 3594 while ( (i + 1 < NUM_RES) 3595 && (sizeList[i + 1][0] < screen.width() * 3 / 4) 3596 && (sizeList[i + 1][1] < screen.height() * 3 / 4)) 3597 ++i; 3598 LogFlowFunc (("Will suggest %d x %d\n", sizeList[i][0], sizeList[i][1])); 3599 mConsole.GetDisplay().SetVideoModeHint (sizeList[i][0], sizeList[i][1], 0, 0); 3600 } 3601 3567 3602 /** 3568 3603 * Sets the the minimum size restriction depending on the auto-resize feature
Note:
See TracChangeset
for help on using the changeset viewer.