VirtualBox

Changeset 66389 in vbox


Ignore:
Timestamp:
Mar 31, 2017 7:20:00 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
114341
Message:

bugref:8151: FE/Qt: improve X11 keyboard capturing: when we grab mouse buttons, make sure we always release them relative to the same X11 window. Possibly fixes public ticket 16562.

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

Legend:

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

    r64831 r66389  
    373373         /* Grab the mouse button.
    374374          * We do not check for failure as we do not currently implement a back-up plan. */
    375          xcb_grab_button_checked(QX11Info::connection(), 0, QX11Info::appRootWindow(),
     375         m_hButtonGrabWindow = QX11Info::appRootWindow();
     376         xcb_grab_button_checked(QX11Info::connection(), 0, m_hButtonGrabWindow,
    376377                                 XCB_EVENT_MASK_BUTTON_PRESS, XCB_GRAB_MODE_SYNC, XCB_GRAB_MODE_ASYNC,
    377378                                 XCB_NONE, XCB_NONE, XCB_BUTTON_INDEX_ANY, XCB_MOD_MASK_ANY);
     
    385386             * We do not check for failure as we do not currently implement a back-up plan. */
    386387            xcb_ungrab_button_checked(QX11Info::connection(), XCB_BUTTON_INDEX_ANY,
    387                                       QX11Info::appRootWindow(), XCB_MOD_MASK_ANY);
     388                                      m_hButtonGrabWindow, XCB_MOD_MASK_ANY);
    388389            /* Try again later: */
    389390            free(pGrabReply);
     
    487488         * We do not check for failure as we do not currently implement a back-up plan. */
    488489        xcb_ungrab_button_checked(QX11Info::connection(), XCB_BUTTON_INDEX_ANY,
    489                                   QX11Info::appRootWindow(), XCB_MOD_MASK_ANY);
     490                                  m_hButtonGrabWindow, XCB_MOD_MASK_ANY);
    490491
    491492# endif /* QT_VERSION >= 0x050000 */
     
    15521553    , m_keyboardHook(NULL)
    15531554    , m_pAltGrMonitor(0)
    1554 #endif /* VBOX_WS_WIN */
     1555#elif defined(VBOX_WS_X11)
     1556# if QT_VERSION >= 0x050000
     1557    , m_hButtonGrabWindow(0)
     1558# endif
     1559#endif /* VBOX_WS_X11 */
    15551560    , m_cMonitors(1)
    15561561{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.h

    r64767 r66389  
    5050# if QT_VERSION < 0x050000
    5151typedef union _XEvent XEvent;
    52 # endif /* QT_VERSION < 0x050000 */
     52#else
     53#  include <xcb/xcb.h>
     54# endif /* QT_VERSION >= 0x050000 */
    5355#endif /* VBOX_WS_X11 */
    5456
     
    243245    /** Win: Holds the keyboard handler reference to be accessible from the keyboard hook. */
    244246    static UIKeyboardHandler *m_spKeyboardHandler;
    245 #endif /* VBOX_WS_WIN */
     247#elif defined(VBOX_WS_X11)
     248# if QT_VERSION >= 0x050000
     249    /** The root window at the time we grab the mouse buttons. */
     250    xcb_window_t m_hButtonGrabWindow;
     251# endif
     252#endif /* VBOX_WS_X11 */
    246253
    247254    ULONG m_cMonitors;
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