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

Alt key modifier stuck after system shortcut in apps with WaylandCompositor

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 5.15.7, 6.2
    • Wayland Compositor
    • None

    Description

      All received keyboard events contain AltModifier after performing system shortcut Alt+Tab.

      Press- release Alt key does not restore the modifiers state.

      The issue is observed on apps which use WaylandCompositor.

      Checked on Ubuntu 20.04 with Qt 5.15.7 and Qt 6.2.3.

      Other Qt versions were not checked.

       

      Attached example based on Qt example Qt/Examples/Qt-6.2.3/wayland/minimal-qml.

      Just Keys.onPressed and Keys.onReleased slots were added to Window content.

       

      Keys.onPressed: (event)=> {
          console.warn("Keys.onPressed: " + JSON.stringify(event));
      }
      Keys.onReleased: (event)=> {
          console.warn("Keys.onReleased: " + JSON.stringify(event));
      }
      

      console output:

       

      •  the first Alt+Tab performed: focus moved app -> QtCreator

      qml: Keys.onPressed: {"objectName":"","key":16777251,"text":"","modifiers":134217728,"isAutoRepeat":false,"count":1,"nativeScanCode":64,"accepted":false}

      Note: key:16777251 = Key_Alt

      • the second Alt+Tab performed: focus moved back QtCreator -> app

      qml: Keys.onReleased: {"objectName":"","key":16777217,"text":"\t","modifiers":134217728,"isAutoRepeat":false,"count":1,"nativeScanCode":23,"accepted":false}

      Note: key:16777217 = Key_Tab, modifiers = AltModifier

      • Then all next key input contains AltModifier, user pressed just "q" key

      qml: Keys.onPressed: {"objectName":"","key":81,"text":"q","modifiers":134217728,"isAutoRepeat":false,"count":1,"nativeScanCode":24,"accepted":false}
      qml: Keys.onReleased: {"objectName":"","key":81,"text":"q","modifiers":134217728,"isAutoRepeat":false,"count":1,"nativeScanCode":24,"accepted":false}

      Note:  key:81 = Key_Qmodifiers = AltModifier

       

       

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.graphics.and.multimedia Qt Graphics Team
              mjnikoff Ivan Maiornykov
              Votes:
              7 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes