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

Right mouse button menu keyboard navigation is broken

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 5.14.2
    • 5.9.4, 5.12.2
    • QPA: X11/XCB
    • None

    Description

      When opening the right mouse button menu - whether using the 3rd mouse button or a dedicated "menu" button - and then not moving the mouse, using the keyboard up/down arrow keys to navigate the menu is impossible as every second or so the focus indicator resets to the first menu entry.

      This happens with all QT applications on Linux X11, and does not happen with GTK+ applications.

      This behavior is not noticed in the following cases:

      1. If the menu opens above the mouse pointer (can happen if the mouse is close to the bottom of the screen).
      2. If the mouse is immediately moved away from the menu after it opens and before trying keyboard navigation.
      3. If the keyboard is used successfully to navigate into a sub-menu (can be done if the user is very quick or the first menu entry is for a sub-menu), then navigation in the sub-menu works fine.

      This behavior does happen if the right mouse button menu is opened to the left of the mouse pointer when the pointer is too close to the right edge of the screen, as in such a scenario the menu doesn't open completely to the left of the mouse pointer - the menu is positioned so that it has exactly enough room to display all the way to the right edge of the screen.

      It seems the problem is that the menu is opened in exactly the mouse pointer location, so that the top-left most pixel of the menu is covered by the menu pointer, and then a periodic task checks whether the mouse pointer is hovering over any menu entry and if so resets the focus to the entry under the mouse - but because the mouse pointer is never moved from 1x1 then QT keeps resetting the focus to the first entry.

      A quick workaround, which is I expect what GTK+ is doing, is to open the mouse right mouse button menu 1 pixel down from the actual pixel where the mouse cursor is pointing to.

      Attachments

        Issue Links

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

          Activity

            People

              liaqi Liang Qi
              guss77 Oded Arbel
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes