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

macOS: setKeyboardGrabEnabled does not work in embedded views

XMLWordPrintable

    • macOS

      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;
      }
      

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

            vestbo Tor Arne Vestbø
            stefan.wastl Stefan Wastl
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes