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

QWidget::hide() resets QApplication::activeWindow(), but does not restore on show

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.4
    • GUI: Window management
    • None
    • All

    Description

      QWidget manages QApplication::activeWindow() via QApplication::setActiveWindow().

      In some cases this is synced with the QWindow activation, via QApplicationPrivate::notifyActiveWindowChange, but in other cases QWidget will reset the active window on its own, without informing QWindow, e.g. in QWidgetPrivate::deactivateWidgetCleanup()

      This causes issues when hiding a QWidget that was the active window, and then showing it again. The QWindow was never deactivated, hence the QWindow does not send an activation event again after showing. Which means that the manual reset that happens on hide() is never restored on show().

      We may need to teach QWidget to pick up the QWindow state on show(), or to plumb the deactivation on show() via QWindow.

       

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes