VirtualBox

Changeset 64181 in vbox


Ignore:
Timestamp:
Oct 9, 2016 8:43:26 AM (8 years ago)
Author:
vboxsync
Message:

bugref:8151: FE/Qt: improve X11 keyboard capturing: a user reported in ticketref:16046 that right-click context menus were broken in a number of panel tools when keyboard capturing was enabled. Quick investigation showed that we were only grabbing the first mouse button for the purposes of doing a quick release of the keyboard capture when it was pressed. This change makes us grab all mouse buttons instead. I was able to verify locally that the user-described problem was reproducible before but not after the change.

File:
1 edited

Legend:

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

    r63899 r64181  
    374374             xcb_grab_button_checked(QX11Info::connection(), 0, QX11Info::appRootWindow(),
    375375                                     XCB_EVENT_MASK_BUTTON_PRESS, XCB_GRAB_MODE_SYNC, XCB_GRAB_MODE_ASYNC,
    376                                      XCB_NONE, XCB_NONE, XCB_BUTTON_INDEX_1, XCB_MOD_MASK_ANY);
     376                                     XCB_NONE, XCB_NONE, XCB_BUTTON_INDEX_ANY, XCB_MOD_MASK_ANY);
    377377        /* And grab the keyboard, using XCB directly, as Qt does not report failure. */
    378378        xcb_grab_keyboard_cookie_t xcbGrabCookie = xcb_grab_keyboard(QX11Info::connection(), false, m_views[m_iKeyboardCaptureViewIndex]->winId(),
     
    383383            /* Release the mouse button grab.
    384384             * We do not check for failure as we do not currently implement a back-up plan. */
    385             xcb_ungrab_button_checked(QX11Info::connection(), XCB_BUTTON_INDEX_1,
     385            xcb_ungrab_button_checked(QX11Info::connection(), XCB_BUTTON_INDEX_ANY,
    386386                                      QX11Info::appRootWindow(), XCB_MOD_MASK_ANY);
    387387            /* Try again later: */
     
    485485        /* Release the mouse button grab.
    486486         * We do not check for failure as we do not currently implement a back-up plan. */
    487         xcb_ungrab_button_checked(QX11Info::connection(), XCB_BUTTON_INDEX_1,
     487        xcb_ungrab_button_checked(QX11Info::connection(), XCB_BUTTON_INDEX_ANY,
    488488                                  QX11Info::appRootWindow(), XCB_MOD_MASK_ANY);
    489489
     
    17791779                /* Release the mouse button grab.
    17801780                 * We do not check for failure as we do not currently implement a back-up plan. */
    1781                 xcb_ungrab_button_checked(QX11Info::connection(), XCB_BUTTON_INDEX_1,
     1781                xcb_ungrab_button_checked(QX11Info::connection(), XCB_BUTTON_INDEX_ANY,
    17821782                                          QX11Info::appRootWindow(), XCB_MOD_MASK_ANY);
    17831783
     
    17911791                    xcb_grab_button_checked(QX11Info::connection(), 0, QX11Info::appRootWindow(),
    17921792                                            XCB_EVENT_MASK_BUTTON_PRESS, XCB_GRAB_MODE_SYNC, XCB_GRAB_MODE_ASYNC,
    1793                                             XCB_NONE, XCB_NONE, XCB_BUTTON_INDEX_1, XCB_MOD_MASK_ANY);
     1793                                            XCB_NONE, XCB_NONE, XCB_BUTTON_INDEX_ANY, XCB_MOD_MASK_ANY);
    17941794
    17951795                break;
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