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

[macOS] Clicking inside a child window with Qt.WindowDoesNotAcceptFocus flag makes the parent window active

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.5.3, 6.7.3, 6.8.0
    • GUI: Window management, QPA
    • None
    • macOS

    Description

      Clicking inside a child window with Qt.WindowDoesNotAcceptFocus flag makes the parent window active. Specific for macOS.

      Code sample:

      import QtQuick
      
      Window {
          width: 640
          height: 480
          visible: true
          title: 'Main window'
      
          Window {
              id: childWindow
              width: 200
              height: 200
              visible: true
              title: 'Child window'
      
              transientParent: null
              flags: Qt.WindowStaysOnTopHint | Qt.WindowDoesNotAcceptFocus
          }
      
          onActiveChanged: {
              console.log('Main window active: ' + active)
          }
      }
      

      Pay attention that transientParent is set to null.

      Steps to reproduce:
      1. Launch the sample code
      2. Make the "Main window" inactive, e.g. by clicking to other app.
      3. Click inside the "Child window"

      See screen recording Screen Recording 2024-10-31 at 13.55.52.mov

      Attachments

        Issue Links

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

          Activity

            People

              vestbo Tor Arne Vestbø
              studiosus Vladimir Belyavsky
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes