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

macOS: Highlighting of Menus not updated correctly

    XMLWordPrintable

Details

    • macOS

    Description

      When selecting different Menu items which open sub menus on macOS with Qt 6.3.2 the menu highlighting some times highlights the previously selected menu while another menu is actually opened.

      A way to reproduce:
      1) use the QML example code which was provided in QTBUG-98716:

      import QtQuick
      import QtQuick.Controls
      
      Window {
          id: window
          width: 1280
          height: 720
          visible: true
      
          Menu {
              id: contextMenu
              title: "MainMenu"
              cascade: true
      
              Menu {
                  title: "Menu 1"
                  MenuItem { text: "Option 1";}
                  MenuItem { text: "Option 2";}
                  MenuItem { text: "Option 3";}
              }
      
              MenuItem { text: "Option 1";}
              MenuItem { text: "Option 2";}
              MenuItem { text: "Option 3";}
      
              Menu {
                  title: "Menu 2"
      
                  Menu {
                      title: "Menu 2.1"
                      MenuItem { text: "Option 1";}
                      MenuItem { text: "Option 2";}
                      MenuItem { text: "Option 3";}
                  }
                  Menu {
                      title: "Menu 2.2"
                      MenuItem { text: "Option 1";}
                      MenuItem { text: "Option 2";}
                      MenuItem { text: "Option 3";}
                  }
              }
              Menu {
                  title: "Menu 3"
      
                  Menu {
                      title: "Menu 3.1"
                      MenuItem { text: "Option 1";}
                      MenuItem { text: "Option 2";}
                      MenuItem { text: "Option 3";}
                  }
                  Menu {
                      title: "Menu 3.2"
                      MenuItem { text: "Option 1";}
                      MenuItem { text: "Option 2";}
                      MenuItem { text: "Option 3";}
                  }
              }
          }
      
          MouseArea {
              anchors.fill: parent
              acceptedButtons: Qt.LeftButton | Qt.RightButton
              onClicked: contextMenu.popup()
              onPressAndHold: {
                  if (mouse.source === Qt.MouseEventNotSynthesized)
                      contextMenu.popup()
              }
          }
      }
      

      2) Right click or left click to open Menus in app
      3) Start clicking the Menus in following order:
      -Menu 2
      -Menu 2.1
      -Menu 2.2
      -Menu 3 (From Menu 2.2, slowly place the cursor to the boarder of shown Sub menu and Menu 3 and when slightly on Menu 3 side, click to display Menu 3.1 and Menu 3.2

      If done carefully enough Menu 2 is highlighted while Menu 3 is actually opened which is not expected behavior. This could alternatively be reproduced accidentally when clicking randomly the menus but likely it is a lot harder to reproduce issue that way.

      Issue might not be reproduced on a first try, so keep clicking those menus in the order described above until this happens.

      Please find attached an image which shows the issue.

      Attachments

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

        Activity

          People

            sami.shalayel Sami Shalayel
            foxxx Tuukka Kettunen
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes