VirtualBox

Changeset 93342 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jan 19, 2022 12:26:59 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10067: Make sure paused VM contents is updated on notification-center sliding animation.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
9 edited

Legend:

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

    r93196 r93342  
    763763    m_iAnimatedValue = iValue;
    764764    adjustGeometry();
     765    emit sigAnimationStep();
    765766}
    766767
     
    799800    /* We do include open-button mask only if center is opened or animated to be: */
    800801    QRegion region;
    801     if (!m_iAnimatedValue)
     802    if (!animatedValue())
    802803        region += QRect(m_pButtonOpen->mapToParent(QPoint(0, 0)), m_pButtonOpen->size());
    803804    setMask(region);
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationCenter.h

    r93115 r93342  
    5555    /** Requests sliding state-machine to close overlay. */
    5656    void sigClose();
     57    /** Notifies listeners about animation step. */
     58    void sigAnimationStep();
    5759
    5860public:
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r93115 r93342  
    247247{
    248248    return frameBuffer() ? (double)(frameBuffer()->width()) / frameBuffer()->height() : 0;
     249}
     250
     251void UIMachineView::updateView()
     252{
     253    viewport()->update();
    249254}
    250255
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h

    r93115 r93342  
    102102    double aspectRatio() const;
    103103
     104    /** Updates machine-view's viewport.
     105      * @remarks Used to update in case of notification-center animation. */
     106    void updateView();
    104107    /** Updates console's display viewport.
    105108      * @remarks Used to update 3D-service overlay viewport as well. */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp

    r93115 r93342  
    178178    /* Update window-title: */
    179179    updateAppearanceOf(UIVisualElement_WindowTitle);
     180}
     181
     182void UIMachineWindow::sltHandleNotificationCenterAnimationStep()
     183{
     184    /* For certain machine states: */
     185    const KMachineState enmState = uisession()->machineState();
     186    switch (enmState)
     187    {
     188        /* Like those related to paused VM: */
     189        case KMachineState_Paused:
     190        case KMachineState_TeleportingPausedVM:
     191        {
     192            /* Update view's viewport, cause we have pause screenshot
     193             * distorted with animation artifacts. */
     194            machineView()->updateView();
     195            break;
     196        }
     197        default:
     198            break;
     199    }
    180200}
    181201
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h

    r93115 r93342  
    125125    virtual void sltMachineStateChanged();
    126126
     127    /** Handles notification-center animation steps. */
     128    void sltHandleNotificationCenterAnimationStep();
     129
    127130protected:
    128131
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp

    r93115 r93342  
    222222{
    223223    if (gpNotificationCenter && (m_uScreenId == 0))
     224    {
    224225        gpNotificationCenter->setParent(centralWidget());
     226        disconnect(gpNotificationCenter, &UINotificationCenter::sigAnimationStep, 0, 0);
     227        connect(gpNotificationCenter, &UINotificationCenter::sigAnimationStep,
     228                this, &UIMachineWindowFullscreen::sltHandleNotificationCenterAnimationStep);
     229    }
    225230}
    226231
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r93115 r93342  
    326326{
    327327    if (gpNotificationCenter && (m_uScreenId == 0))
     328    {
    328329        gpNotificationCenter->setParent(centralWidget());
     330        disconnect(gpNotificationCenter, &UINotificationCenter::sigAnimationStep, 0, 0);
     331        connect(gpNotificationCenter, &UINotificationCenter::sigAnimationStep,
     332                this, &UIMachineWindowNormal::sltHandleNotificationCenterAnimationStep);
     333    }
    329334}
    330335
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.cpp

    r93115 r93342  
    6262{
    6363    if (gpNotificationCenter && (m_uScreenId == 0))
     64    {
    6465        gpNotificationCenter->setParent(centralWidget());
     66        disconnect(gpNotificationCenter, &UINotificationCenter::sigAnimationStep, 0, 0);
     67        connect(gpNotificationCenter, &UINotificationCenter::sigAnimationStep,
     68                this, &UIMachineWindowScale::sltHandleNotificationCenterAnimationStep);
     69    }
    6570}
    6671
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