VirtualBox

Changeset 7483 in vbox


Ignore:
Timestamp:
Mar 18, 2008 9:10:39 AM (17 years ago)
Author:
vboxsync
Message:

Frontends/VirtualBox: do not suggest a new initial resolution if the saved one is too big for the screen, since we now implement the VideoModeSupported request

Location:
trunk/src/VBox/Frontends
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp

    r7463 r7483  
    36083608
    36093609/**
    3610  * We send an initial size hint to the VM on startup, so that it can choose
    3611  * 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).
    36123612 */
    36133613void VBoxConsoleView::sendInitialSizeHint(void)
     
    36213621        h = str.section (',', 1, 1).toInt (&ok);
    36223622    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    }
    36453628}
    36463629
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleView.cpp

    r7463 r7483  
    36023602 
    36033603/**
    3604  * We send an initial size hint to the VM on startup, so that it can choose
    3605  * 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).
    36063606 */
    36073607void VBoxConsoleView::sendInitialSizeHint(void)
     
    36153615        h = str.section (',', 1, 1).toInt (&ok);
    36163616    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    }
    36393622}
    36403623
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette