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

setFocus does not work when hiding modal window if a click outside the modal window occurred while it was displayed.

    XMLWordPrintable

Details

    • Linux/X11

    Description

      This problem has been seen running on CentOS, using the kwin window manager.

      It does not happen using XWin32 remoting into a Linux machine from Windows.

       

      Focus fails to return to the main window when the popup closes IF you clicked on the mainwindow while the popup was displayed; instead focus goes to null.

      Further, if you click the button to display the popup again, it does not gain focus when it should, but the focus widget and active window stay null.

       

      Steps to reproduce using the attached reproducer:

       

      To reproduce : build and run the program.

      Normal case:

      • the main window has focus.
      • click the button, the popup is displayed and gets the focus.
      • press escape, the popup closes and the main window gets focus back.
      • repeat.

       

      Bad case:

      • the main window has focus.
      • click the button, the popup is displayed and gets the focus.
      • click on the main window behind the popup...
        (Qt focus widget and active window don't change, but Kwin seems to highlight the main window like it got focus)
      • press escape, the popup closes and the focus widget and active window go null, despite the setFocus call, which has no effect.
      • click the button, the popup is displayed but does not get the focus.
      • click on the main window behind the popup...
        (Qt focus widget and active window don't change, but Kwin seems to highlight the main window like it got focus)
      • press escape, the popup closes and the focus widget and active window remain null.
      • click the button, the popup is displayed but does not get the focus.
      • do NOT click outside the popup.
      • press escape, the popup closes and the main window gets focus back.
      • repeat.

       

       

      Attachments

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

        Activity

          People

            axelspoerl Axel Spoerl
            joshua.fletcher Joshua Fletcher
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes