VirtualBox

Changeset 72393 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 30, 2018 3:24:13 PM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: fix X11 host keyboard repeat handling again.
bugref:9189: FE/Qt: handle key repeat correctly in Qt5/X11 code
X11 has a rather idiosyncratic way of handling key repeat: it sends key up
and key down events, which confuses our X11 host keyboard handling. This was
reported in public ticket 1296 and fixed by manually suppressing the key up
events, but the fix got lost during the migration to Qt5, which required
converting Xlib code to (mainly) XCB.
Xkb added a way to suppress this idiosyncratic behaviour, see
https://stackoverflow.com/a/2102689
This change implements that instead of the old fix.

File:
1 edited

Legend:

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

    r69500 r72393  
    828828            }
    829829
    830 //            /* Fix for http://www.virtualbox.org/ticket/1296:
    831 //             * when X11 sends events for repeated keys, it always inserts an XKeyRelease before the XKeyPress. */
    832 //            XEvent returnEvent;
    833 //            if ((pEvent->type == XKeyRelease) && (XCheckIfEvent(pEvent->xkey.display, &returnEvent,
    834 //                UIKeyboardHandlerCompEvent, (XPointer)pEvent) == True))
    835 //            {
    836 //                XPutBackEvent(pEvent->xkey.display, &returnEvent);
    837 //                fResult = true;
    838 //                break;
    839 //            }
    840 
    841830            /* Calculate flags: */
    842831            int iflags = 0;
     
    10291018    /* Initialize the X keyboard subsystem: */
    10301019    initMappedX11Keyboard(QX11Info::display(), gEDataManager->remappedScanCodes());
     1020    /* Fix for http://www.virtualbox.org/ticket/1296:
     1021     * when X11 sends events for repeated keys, it always inserts an XKeyRelease
     1022     * before the XKeyPress. */
     1023    /* Disable key release events during key auto-repeat: */
     1024    XkbSetDetectableAutoRepeat(QX11Info::display(), True, NULL);
    10311025#endif /* VBOX_WS_X11 */
    10321026
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