VirtualBox

Changeset 67031 in vbox for trunk


Ignore:
Timestamp:
May 23, 2017 9:55:30 AM (8 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8867: FE/Qt: user report: VM window size not being restored for jessie VMs
Try suppressing size hints sent from the window to the virtual machine if they match the current virtual screen size.

File:
1 edited

Legend:

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

    r66588 r67031  
    312312    /* Send new size-hint to the guest: */
    313313    LogRel(("GUI: UIMachineView::sltPerformGuestResize: "
    314             "Sending guest size-hint to screen %d as %dx%d\n",
     314            "Sending guest size-hint to screen %d as %dx%d if necessary\n",
    315315            (int)screenId(), size.width(), size.height()));
    316316
     
    318318    if (gEDataManager->autoMountGuestScreensEnabled(vboxGlobal().managedVMUuid()))
    319319    {
    320         /* If host and guest have same opinion about guest-screen visibility: */
    321         if (uisession()->isScreenVisible(screenId()) == uisession()->isScreenVisibleHostDesires(screenId()))
     320        /* Do not send a hint if nothing has changed to prevent the guest being notified about its own changes: */
     321        if (   (int)m_pFrameBuffer->width() != size.width() || (int)m_pFrameBuffer->height() != size.height()
     322            || uisession()->isScreenVisible(screenId()) != uisession()->isScreenVisibleHostDesires(screenId()))
     323        {
     324            /* If host and guest have same opinion about guest-screen visibility: */
     325            if (uisession()->isScreenVisible(screenId()) == uisession()->isScreenVisibleHostDesires(screenId()))
     326                display().SetVideoModeHint(screenId(),
     327                                           uisession()->isScreenVisible(screenId()),
     328                                           false, 0, 0, size.width(), size.height(), 0);
     329            /* If host desires to have guest-screen disabled and guest-screen is enabled, retrying: */
     330            else if (!uisession()->isScreenVisibleHostDesires(screenId()))
     331                display().SetVideoModeHint(screenId(), false, false, 0, 0, 0, 0, 0);
     332            /* If host desires to have guest-screen enabled and guest-screen is disabled, retrying: */
     333            else if (uisession()->isScreenVisibleHostDesires(screenId()))
     334                display().SetVideoModeHint(screenId(), true, false, 0, 0, size.width(), size.height(), 0);
     335        }
     336    }
     337    /* If auto-mount of guest-screens (auto-pilot) disabled: */
     338    else
     339    {
     340        /* Do not send a hint if nothing has changed to prevent the guest being notified about its own changes: */
     341        if ((int)m_pFrameBuffer->width() != size.width() || (int)m_pFrameBuffer->height() != size.height())
    322342            display().SetVideoModeHint(screenId(),
    323343                                       uisession()->isScreenVisible(screenId()),
    324344                                       false, 0, 0, size.width(), size.height(), 0);
    325         /* If host desires to have guest-screen disabled and guest-screen is enabled, retrying: */
    326         else if (!uisession()->isScreenVisibleHostDesires(screenId()))
    327             display().SetVideoModeHint(screenId(), false, false, 0, 0, 0, 0, 0);
    328         /* If host desires to have guest-screen enabled and guest-screen is disabled, retrying: */
    329         else if (uisession()->isScreenVisibleHostDesires(screenId()))
    330             display().SetVideoModeHint(screenId(), true, false, 0, 0, size.width(), size.height(), 0);
    331     }
    332     /* If auto-mount of guest-screens (auto-pilot) disabled: */
    333     else
    334     {
    335         display().SetVideoModeHint(screenId(),
    336                                    uisession()->isScreenVisible(screenId()),
    337                                    false, 0, 0, size.width(), size.height(), 0);
    338345    }
    339346}
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