VirtualBox

Changeset 98400 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 1, 2023 2:50:42 PM (23 months ago)
Author:
vboxsync
Message:

Merging r155336 from gui4 branch: FE/Qt: Runtime UI: Move more keyboard stuff from UIMachineLogic to UIMachine.

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:mergeinfo
      •  

        old new  
        1919/branches/dsen/gui2:79224,79228,79233,79235,79258,79262-79263,79273,79341,79345,79354,79357,79387-79388,79559-79569,79572-79573,79578,79581-79582,79590-79591,79598-79599,79602-79603,79605-79606,79632,79635,79637,79644
        2020/branches/dsen/gui3:79645-79692
        21 /branches/dsen/gui4:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311,155316
         21/branches/dsen/gui4:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311,155316,155336
        2222/trunk/src:92342,154921
  • trunk/src/VBox

    • Property svn:mergeinfo
      •  

        old new  
        1919/branches/dsen/gui2/src/VBox:79224,79228,79233,79235,79258,79262-79263,79273,79341,79345,79354,79357,79387-79388,79559-79569,79572-79573,79578,79581-79582,79590-79591,79598-79599,79602-79603,79605-79606,79632,79635,79637,79644
        2020/branches/dsen/gui3/src/VBox:79645-79692
        21 /branches/dsen/gui4/src/VBox:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311,155316
         21/branches/dsen/gui4/src/VBox:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311,155316,155336
  • trunk/src/VBox/Frontends

    • Property svn:mergeinfo
      •  

        old new  
        1616/branches/dsen/gui2/src/VBox/Frontends:79224,79228,79233,79235,79258,79262-79263,79273,79341,79345,79354,79357,79387-79388,79559-79569,79572-79573,79578,79581-79582,79590-79591,79598-79599,79602-79603,79605-79606,79632,79635,79637,79644
        1717/branches/dsen/gui3/src/VBox/Frontends:79645-79692
        18 /branches/dsen/gui4/src/VBox/Frontends:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311,155316
         18/branches/dsen/gui4/src/VBox/Frontends:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311,155316,155336
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp

    r98385 r98400  
    14531453        /* If HID LEDs sync is disabled or not supported, check if the guest has the
    14541454         * same view on the modifier keys (NumLock, CapsLock, ScrollLock) as the host. */
    1455         if (!machineLogic()->isHidLedsSyncEnabled())
     1455        if (!uimachine()->isHidLedsSyncEnabled())
    14561456            if (fFlags & KeyPressed)
    14571457                fixModifierState(pCodes, puCodesCount);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp

    r98399 r98400  
    698698    , m_uNumLockAdaptionCnt(2)
    699699    , m_uCapsLockAdaptionCnt(2)
     700    , m_fIsHidLedsSyncEnabled(false)
    700701    , m_iKeyboardState(0)
    701702    , m_fIsHidingHostPointer(true)
     
    735736    prepareScreens();
    736737    prepareBranding();
     738    prepareKeyboard();
    737739    prepareMachineLogic();
    738740
     
    989991}
    990992
     993void UIMachine::prepareKeyboard()
     994{
     995#if defined(VBOX_WS_MAC) || defined(VBOX_WS_WIN)
     996    /* Load extra-data value: */
     997    m_fIsHidLedsSyncEnabled = gEDataManager->hidLedsSyncState(uiCommon().managedVMUuid());
     998    /* Connect to extra-data changes to be able to enable/disable feature dynamically: */
     999    connect(gEDataManager, &UIExtraDataManager::sigHidLedsSyncStateChange,
     1000            this, &UIMachine::sltHidLedsSyncStateChanged);
     1001#endif /* VBOX_WS_MAC || VBOX_WS_WIN */
     1002}
     1003
    9911004void UIMachine::prepareMachineLogic()
    9921005{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h

    r98399 r98400  
    245245        void setCapsLockAdaptionCnt(uint uCount) { m_uCapsLockAdaptionCnt = uCount; }
    246246
     247        /** Returns whether VM should perform HID LEDs synchronization. */
     248        bool isHidLedsSyncEnabled() const { return m_fIsHidLedsSyncEnabled; }
     249
    247250        /** Returns the keyboard-state. */
    248251        int keyboardState() const { return m_iKeyboardState; }
     
    371374          * @param  fScrollLock  Brings SCROLL lock status. */
    372375        void sltHandleKeyboardLedsChange(bool fNumLock, bool fCapsLock, bool fScrollLock);
     376
     377        /** Handles signal about keyboard LEDs sync state change.
     378          * @param  fEnabled  Brings sync status. */
     379        void sltHidLedsSyncStateChanged(bool fEnabled) { m_fIsHidLedsSyncEnabled = fEnabled; }
    373380    /** @} */
    374381
     
    413420    /** Prepare routine: Actions stuff. */
    414421    void prepareActions();
     422    /** Prepare routine: Keyboard stuff. */
     423    void prepareKeyboard();
    415424    /** Prepare routine: Machine-logic stuff. */
    416425    void prepareMachineLogic();
     
    555564        uint  m_uCapsLockAdaptionCnt;
    556565
     566        /** Holds whether VM should perform HID LEDs synchronization. */
     567        bool m_fIsHidLedsSyncEnabled;
     568
    557569        /** Holds the keyboard-state. */
    558570        int  m_iKeyboardState;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r98399 r98400  
    609609}
    610610
    611 void UIMachineLogic::sltHidLedsSyncStateChanged(bool fEnabled)
    612 {
    613     m_fIsHidLedsSyncEnabled = fEnabled;
    614 }
    615 
    616611void UIMachineLogic::sltDisableHostScreenSaverStateChanged(bool fDisabled)
    617612{
     
    633628     * [bool] uisession() -> isNumLock(), isCapsLock(), isScrollLock() can be used for that. */
    634629
    635     if (!isHidLedsSyncEnabled())
     630    if (!uimachine()->isHidLedsSyncEnabled())
    636631        return;
    637632
     
    785780#endif /* VBOX_WS_MAC */
    786781    , m_pHostLedsState(NULL)
    787     , m_fIsHidLedsSyncEnabled(false)
    788782    , m_pLogViewerDialog(0)
    789783    , m_pFileManagerDialog(0)
     
    13811375void UIMachineLogic::loadSettings()
    13821376{
    1383 #if defined(VBOX_WS_MAC) || defined(VBOX_WS_WIN)
    1384     /* Read cached extra-data value: */
    1385     m_fIsHidLedsSyncEnabled = gEDataManager->hidLedsSyncState(uiCommon().managedVMUuid());
    1386     /* Subscribe to extra-data changes to be able to enable/disable feature dynamically: */
    1387     connect(gEDataManager, &UIExtraDataManager::sigHidLedsSyncStateChange, this, &UIMachineLogic::sltHidLedsSyncStateChanged);
    1388 #endif /* VBOX_WS_MAC || VBOX_WS_WIN */
    13891377    /* HID LEDs sync initialization: */
    13901378    sltSwitchKeyboardLedsToGuestLeds();
    1391     /* */
     1379
    13921380#if defined(VBOX_WS_X11) || defined(VBOX_WS_WIN)
    13931381    connect(gEDataManager, &UIExtraDataManager::sigDisableHostScreenSaverStateChange,
     
    14791467                     * won't be called in sltSwitchKeyboardLedsToGuestLeds() and guest
    14801468                     * will loose keyboard input forever. */
    1481                     if (isHidLedsSyncEnabled())
     1469                    if (uimachine()->isHidLedsSyncEnabled())
    14821470                    {
    14831471                        keyboardHandler()->winSkipKeyboardEvents(true);
     
    26762664     * [bool] uisession() -> isNumLock(), isCapsLock(), isScrollLock() can be used for that. */
    26772665
    2678     if (!isHidLedsSyncEnabled())
     2666    if (!uimachine()->isHidLedsSyncEnabled())
    26792667        return;
    26802668
     
    27032691//           machineName().toUtf8().constData());
    27042692
    2705     if (!isHidLedsSyncEnabled())
     2693    if (!uimachine()->isHidLedsSyncEnabled())
    27062694        return;
    27072695
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h

    r98375 r98400  
    161161#endif /* VBOX_WS_MAC */
    162162
    163     /** Returns whether VM should perform HID LEDs synchronization. */
    164     bool isHidLedsSyncEnabled() const { return m_fIsHidLedsSyncEnabled; }
    165163    /** An public interface to sltTypeHostKeyComboPressRelease. */
    166164    void typeHostKeyComboPressRelease(bool fToggleSequence);
     
    362360
    363361    /* Handlers: Keyboard LEDs sync logic: */
    364     void sltHidLedsSyncStateChanged(bool fEnabled);
    365362    void sltSwitchKeyboardLedsToGuestLeds();
    366363    void sltSwitchKeyboardLedsToPreviousLeds();
     
    457454    void *m_pHostLedsState;
    458455
    459     /** Holds whether VM should perform HID LEDs synchronization. */
    460     bool m_fIsHidLedsSyncEnabled;
    461 
    462456    /** Holds the map of settings dialogs. */
    463457    QMap<UISettingsDialog::DialogType, UISettingsDialog*>  m_settings;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r98399 r98400  
    179179#if defined(VBOX_WS_MAC) || defined(VBOX_WS_WIN)
    180180    LogRel(("GUI: HID LEDs sync is %s\n",
    181             uimachine()->machineLogic()->isHidLedsSyncEnabled()
     181            uimachine()->isHidLedsSyncEnabled()
    182182            ? "enabled" : "disabled"));
    183183#else /* !VBOX_WS_MAC && !VBOX_WS_WIN */
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