VirtualBox

Ignore:
Timestamp:
Aug 22, 2016 1:37:35 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
110318
Message:

FE/Qt: bugref:8151: Runtime UI: Use the 'delayed keyboard capture' approach on Windows.

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

Legend:

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

    r63601 r63608  
    3939# ifdef VBOX_WS_X11
    4040#  include <QX11Info>
    41 #  if QT_VERSION >= 0x050000
     41# endif
     42# if !defined(VBOX_WS_MAC) && QT_VERSION >= 0x050000
    4243#   include <QTimer>
    43 #  endif
    4444# endif
    4545
     
    281281         * a low-level keyboard-hook is used instead.
    282282         * It is being installed on focus-in event and uninstalled on focus-out.
    283          * S.a. UIKeyboardHandler::eventFilter for more information. */
     283         * S.a. UIKeyboardHandler::eventFilter for more information.
     284         *
     285         * Besides that, we do not grab the keyboard as soon as it is captured,
     286         * but delay it for 300 milliseconds after the formal capture.
     287         * We do it mainly to have the common behavior under all
     288         * hosts and X11 is forced to behave that way. */
     289
     290        /* Delay finalising capture for 300 milliseconds: */
     291        QTimer::singleShot(300, this, SLOT(sltFinaliseCaptureKeyboard()));
    284292
    285293#elif defined(VBOX_WS_X11)
     
    352360        m_iKeyboardCaptureViewIndex = uScreenId;
    353361
    354 #if !defined(VBOX_WS_X11) || QT_VERSION < 0x050000
     362#if defined(VBOX_WS_MAC) || QT_VERSION < 0x050000
    355363        /* Finalise keyboard capture: */
    356364        finaliseCaptureKeyboard();
     
    15091517}
    15101518
    1511 #if defined(VBOX_WS_X11) && QT_VERSION >= 0x050000
     1519#if !defined(VBOX_WS_MAC) && QT_VERSION >= 0x050000
    15121520void UIKeyboardHandler::sltFinaliseCaptureKeyboard()
    15131521{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.h

    r63599 r63608  
    133133    virtual void sltMachineStateChanged();
    134134
    135 #if defined(VBOX_WS_X11) && QT_VERSION >= 0x050000
     135#if !defined(VBOX_WS_MAC) && QT_VERSION >= 0x050000
    136136    /** Finalises keyboard capture. */
    137137    void sltFinaliseCaptureKeyboard();
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette