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

Drag-selecting menu item works inconsistently with -nograb on Linux



    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Won't Do
    • Affects Version/s: 5.5.0
    • Fix Version/s: None
    • Labels:
    • Environment:


      Press and hold the menu and drag down to submenu. If application is started with -nograb, then releasing the mouse on an item may not trigger the menu item (for instance, when a widget is under the menu item). If a QGLWidget is a part of the window, then all menu items will trigger as expected. The problem is not reproduced when grabs are enabled during the run of the application. This bug is similar to the report on QTBUG-31937, which was reported against Mac and fixed Cocoa platform specific code.

      Observations made during testing of this bug is that an enter event is never seen when moving down to the submenu; however, a leave event is seen. This pattern sets the action to null (actions cleared in QMenu::leaveEvent "setActiveAction(0);") QMenu::mouseReleaseEvent "if (action && action == d->currentAction)" The release event gets the correct action, but currentAction is not set, so the action is not triggered.

      Test code from QTBUG-31937 can also demonstrate this bug under Linux. Test is found in qtbase/tests/manual/cocoa/popups/main.cpp. Attach version of file adds QGLWidget to the test.

      Run the test with the -nograb option. If you press and hold the mouse on the pop up menu and drag the mouse to one of the menu options, the option will only trigger if the mouse cursor is not over a widget (example: text edit box or button) on release. Over the window background the menu will trigger. Once you push the button to create a QGLWidget, all menu items will trigger on release. Even if the QGLWidget is then destroyed with the button, all the menu actions continue to trigger (the QGLWidget just needs to be shown once to get the menu items to trigger).


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



            Unassigned Unassigned
            razorback17 Brendan McGeehan
            0 Vote for this issue
            3 Start watching this issue



                Gerrit Reviews

                There are no open Gerrit changes