VirtualBox

Changeset 99072 in vbox for trunk


Ignore:
Timestamp:
Mar 20, 2023 4:36:56 PM (21 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10322: Runtime UI: A bit of cleanup for mouse handler and indicator.

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

Legend:

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

    r99071 r99072  
    851851        connect(m_pMachine, &UIMachine::sigMouseStateChange,
    852852                this, static_cast<void(UIIndicatorMouse::*)(int)>(&UIIndicatorMouse::setState));
    853         setState(m_pMachine->mouseState());
    854853        /* Translate finally: */
    855854        retranslateUi();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp

    r98601 r99072  
    253253int UIMouseHandler::state() const
    254254{
    255     return (uimachine()->isMouseCaptured() ? UIMouseStateType_MouseCaptured : 0) |
     255    return uimachine()->machineState() == KMachineState_Null ? 0 :
     256           (uimachine()->isMouseCaptured() ? UIMouseStateType_MouseCaptured : 0) |
    256257           (uimachine()->isMouseSupportsAbsolute() ? UIMouseStateType_MouseAbsolute : 0) |
    257258           (uimachine()->isMouseIntegrated() ? 0 : UIMouseStateType_MouseAbsoluteDisabled);
     
    367368void UIMouseHandler::sltMachineStateChanged()
    368369{
    369     /* Get machine state: */
    370     KMachineState machineState = uimachine()->machineState();
     370    /* Get cached machine states: */
     371    const KMachineState enmState = uimachine()->machineState();
     372
    371373    /* Handle particular machine states: */
    372     switch (machineState)
     374    switch (enmState)
    373375    {
    374376        case KMachineState_Paused:
     
    387389     * if we are not in paused VM state already: */
    388390    if (machineLogic()->activeMachineWindow() &&
    389         machineState != KMachineState_Paused &&
    390         machineState != KMachineState_TeleportingPausedVM)
     391        enmState != KMachineState_Paused &&
     392        enmState != KMachineState_TeleportingPausedVM)
    391393        UINotificationMessage::forgetAboutPausedVMInput();
    392394
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