Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-57335

QKeyEvent::isAutoRepeat sometimes wrongly false in keyReleaseEvent

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.5.1, 5.8.0 Beta
    • Fix Version/s: 5.12.0 Alpha
    • Component/s: QPA: X11/XCB
    • Labels:
      None
    • Environment:
      ubuntu 16.04 with qt 5.5.1, also verified with 5.8.0
    • Commits:
      21f976f4f0f79b1c4c77a402ebed88d8afb3d9e1

      Description

      This relates to ubuntu 16.04:
      When pressing down a key and holding it, keyReleaseEvent sometimes wrongly reports isAutoRepeat as false. This has been reported infrequently by others (QTBUG-20387, https://forum.qt.io/topic/68803/problem-with-qkeyevent-isautorepeat-function, http://stackoverflow.com/questions/38102221/qkeyevent-isautorepeat-not-working#38122074).
      To track it down, I messed with the event-lookahead for keypress in qtbase/src/plugins/platforms/xcb/qxcbkeyboard.cpp:1525. After adding a short usleep, allowing the outstanding generated events to arrive made the problem completely go away:

             // look ahead for auto-repeat
              KeyChecker checker(source->xcb_window(), code, time, state);
              usleep (500); // On my (old and outworn slow laptop (Intel® Celeron(R) CPU N2830 @ 2.16GHz × 2)):100: very rarely sometimes false key-releases 200: ok.
              xcb_generic_event_t *event = connection()->checkEvent(checker);
      

      So maybe it would be helpful to add such a usleep

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              paeglis Gatis Paeglis
              Reporter:
              pbhd0815 Peter Bauer
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes