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

[reg 5.12 b1->5.12 rc]/Windows: VST-embedded Qt app can't get focus back after clicking outside

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.12.1
    • 5.12.0 Beta 2, 5.12.0 RC
    • None
    • Windows
    • 70d131af33c8b411f430d0699b4294b5976db8e3 (qt/qtbase/5.12)

    Description

      I'm developping a VST plugin using Qt, used inside non-Qt host applications.

      Since Qt 5.12 Beta 2, once my Qt VST plugin lose focus (because an external area is clicked, for instance a part of the host application), it can't get it back (this is normally achieved by clicking any part of the plugin UI).

      This was working with Qt 5.12 Beta 1, and the problem starts with 5.12 Beta 2 (and affects 5.12 RC as well).

      The problem comes from the QtWidgets module (replacing only this dll between beta 1 and 2 triggers the problem).

      Looking at the changelog between beta 1 and 2 ( https://lists.qt-project.org/pipermail/releasing/attachments/20181016/7a114e0a/attachment-0001.txt ) it's very likely this commit is responsible for this regression:

      bde6a049494f40cd71004d6926899f115af0c3e6 QtWidgets: Fix Qt application coming to the foreground when launching app by popup menu ( https://codereview.qt-project.org/#/c/241871/ )

      When I add the following code to all of my plugin widgets, I can get the focus back:

      bool MyWidget::event(QEvent *e)
      {
          if(e->type()==QEvent::FocusIn && window() && window()->windowHandle())
              window()->windowHandle()->requestActivate();
          return QWidget::event(e);
      }

      Which seems to confirm the problem is linked with the commit mentionned above.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-71991
          # Subject Branch Project Status CR V

          Activity

            People

              kleint Friedemann Kleint
              divide Robin Lobel
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes