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

macOS: setKeyboardGrabEnabled does not work in embedded views

    XMLWordPrintable

Details

    • macOS

    Description

      As noticable here, keyboard focus cannot be applied when hosting a QWindow into a foreign view/window, as the embedded use case is ignored.

      A likely solution would be to simply extend the current implementation like this:

      bool QCocoaWindow::setKeyboardGrabEnabled(bool grab)
      {    
          qCDebug(lcQpaWindow) << "QCocoaWindow::setKeyboardGrabEnabled" << window() << grab;    
          if (!isContentView() && !isEmbedded())        
              return false;
      
          if (grab && [m_view.window] &&![m_view.window isKeyWindow])
              [m_view.window makeKeyWindow];
      
          return true;
      }
      

      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ø
              stefan.wastl Stefan Wastl
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes