Changeset 7483 in vbox
- Timestamp:
- Mar 18, 2008 9:10:39 AM (17 years ago)
- Location:
- trunk/src/VBox/Frontends
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
r7463 r7483 3608 3608 3609 3609 /** 3610 * We send an initial size hint to the VM on startup, so that it can choose3611 * an initial size which is well-readable on the host screen.3610 * We send an initial size hint to the VM on startup, based on the last 3611 * resize event in the last session (if any). 3612 3612 */ 3613 3613 void VBoxConsoleView::sendInitialSizeHint(void) … … 3621 3621 h = str.section (',', 1, 1).toInt (&ok); 3622 3622 QRect screen = QApplication::desktop()->screenGeometry (this); 3623 if (!ok || w > screen.width() || h > screen.height()) 3624 { 3625 static const int sizeList[][2] = 3626 { 3627 { 640, 480 }, 3628 { 800, 600 }, 3629 { 1024, 768 }, 3630 { 1280, 960 } 3631 }; 3632 unsigned i = 0; 3633 3634 /* Find a size that is smaller than three quarters of the reported 3635 screen geometry. */ 3636 while ( i + 1 < RT_ELEMENTS (sizeList) 3637 && sizeList[i + 1][0] < screen.width() * 3 / 4 3638 && sizeList[i + 1][1] < screen.height() * 3 / 4) 3639 ++i; 3640 w = sizeList[i][0]; 3641 h = sizeList[i][1]; 3642 } 3643 LogFlowFunc (("Will suggest %d x %d\n", w, h)); 3644 mConsole.GetDisplay().SetVideoModeHint (w, h, 0, 0); 3623 if (ok && w <= screen.width() && h <= screen.height()) 3624 { 3625 LogFlowFunc (("Will suggest %d x %d\n", w, h)); 3626 mConsole.GetDisplay().SetVideoModeHint (w, h, 0, 0); 3627 } 3645 3628 } 3646 3629 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleView.cpp
r7463 r7483 3602 3602 3603 3603 /** 3604 * We send an initial size hint to the VM on startup, so that it can choose3605 * an initial size which is well-readable on the host screen.3604 * We send an initial size hint to the VM on startup, based on the last 3605 * resize event in the last session (if any). 3606 3606 */ 3607 3607 void VBoxConsoleView::sendInitialSizeHint(void) … … 3615 3615 h = str.section (',', 1, 1).toInt (&ok); 3616 3616 QRect screen = QApplication::desktop()->screenGeometry (this); 3617 if (!ok || w > screen.width() || h > screen.height()) 3618 { 3619 static const int sizeList[][2] = 3620 { 3621 { 640, 480 }, 3622 { 800, 600 }, 3623 { 1024, 768 }, 3624 { 1280, 960 } 3625 }; 3626 unsigned i = 0; 3627 3628 /* Find a size that is smaller than three quarters of the reported 3629 screen geometry. */ 3630 while ( i + 1 < RT_ELEMENTS (sizeList) 3631 && sizeList[i + 1][0] < screen.width() * 3 / 4 3632 && sizeList[i + 1][1] < screen.height() * 3 / 4) 3633 ++i; 3634 w = sizeList[i][0]; 3635 h = sizeList[i][1]; 3636 } 3637 LogFlowFunc (("Will suggest %d x %d\n", w, h)); 3638 mConsole.GetDisplay().SetVideoModeHint (w, h, 0, 0); 3617 if (ok && w <= screen.width() && h <= screen.height()) 3618 { 3619 LogFlowFunc (("Will suggest %d x %d\n", w, h)); 3620 mConsole.GetDisplay().SetVideoModeHint (w, h, 0, 0); 3621 } 3639 3622 } 3640 3623
Note:
See TracChangeset
for help on using the changeset viewer.