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

Unwanted focus gain when adding a QMdiSubwindow to a QMdiArea when the QMainWindow is not active

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • Some future release
    • 4.5.3, 4.6.2
    • GUI: Window management
    • None
    • Linux / qt4.6.2

    Description

      Imagine a simple program that consists of a QMainWindow with a QMdiArea, like the "MDI Example" in qt4 documentation. A QMainSubwindow can be created and added to the QMdiArea through direct user interaction on the gui; when we add a QMainSubwindow to a QMdiArea, if the previous QMdiArea::currentSubWindow() was maximized, the new one will be maximized, too. Everything works fine.
      Now imagine to code a program where a QMainSubwindow could also be created as a consequence of an external event (such as a network event) or other kind of event (such a QTimer slot).
      In this last example, the QMainWindow is not guaranteed to be the active window in the desktop/window manager. When the newly added QMainSubwindow gets automatically maximized, it will steal the focus to the currently open window in the destkop/window manager and gain it.
      This has been tested on linux and happens with gnome/xfce, while on kde it only happens if the kwin's focus stealing prevention policy is disabled.

      Attachments

        1. mdi.tar.gz
          4 kB
          Fabio Bas
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            dedietri Gabriel de Dietrich (drgvond)
            ctrlaltca Fabio Bas
            Votes:
            5 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes