VirtualBox

Changeset 98010 in vbox


Ignore:
Timestamp:
Jan 6, 2023 12:54:07 PM (2 years ago)
Author:
vboxsync
Message:

FE/Qt: Runtime UI: Make sure the technique to go back to previous resolution on exiting full-screen/seamless mode is HiDPI aware; Also, change fallback size from 800x600 to 640x480 as it's still our standard for now.

File:
1 edited

Legend:

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

    r97978 r98010  
    153153
    154154    /* Get the last guest-screen size-hint, taking the scale factor into account. */
    155     const QSize sizeHint = scaledBackward(storedGuestScreenSizeHint());
     155    const QSize storedSizeHint = storedGuestScreenSizeHint();
     156    const QSize effectiveSizeHint = scaledBackward(storedSizeHint);
    156157    LogRel(("GUI: UIMachineViewNormal::resendSizeHint: Restoring guest size-hint for screen %d to %dx%d\n",
    157             (int)screenId(), sizeHint.width(), sizeHint.height()));
     158            (int)screenId(), effectiveSizeHint.width(), effectiveSizeHint.height()));
    158159
    159160    /* Expand current limitations: */
    160     setMaximumGuestSize(sizeHint);
     161    setMaximumGuestSize(effectiveSizeHint);
    161162
    162163    /* Temporarily restrict the size to prevent a brief resize to the
     
    164165     * applied if the frame-buffer is at full-screen dimensions and
    165166     * until the first machine view resize. */
    166     m_sizeHintOverride = QSize(800, 600).expandedTo(sizeHint);
     167    m_sizeHintOverride = scaledForward(QSize(640, 480)).expandedTo(storedSizeHint);
    167168
    168169    /* Restore saved monitor information to the guest.  The guest may not respond
     
    174175    display().SetVideoModeHint(screenId(),
    175176                               guestScreenVisibilityStatus(),
    176                                false, 0, 0, sizeHint.width(), sizeHint.height(), 0, false);
     177                               false, 0, 0, effectiveSizeHint.width(), effectiveSizeHint.height(), 0, false);
    177178}
    178179
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