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

Wrong focus and window activation behavior when a menu is opened

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 4.6.2
    • None
    • Windows 7: Qt SDK 2010.02.1
      Ubuntu: Qt 4.6.2
      Symbian: Emulator & Qt 4.6.2
    • 5ae2cbe99d06e1f1d037cd9a7868f2e1fd3f4c4c

    Description

      There are issues in Qt/Symbian implementation considering the activation and focus behavior when opening menus. With the attached test application they can be reproduced by opening the menu in the menubar by clicking on it and observing the debug output where relevant events are logged. Below is the relevant part of the application's debug output from 3 platforms:

      Win 7:
      DropDownMn: aboutToShow()
      DropDownMn: QZOrderChangeEvent(0x22cb8c)
      LineEditor: QFocusOutEvent(0x22cba8) 4
      DropDownMn: QShowEvent(0x22cbe0)
      DropDownMn: QShowToParentEvent(0x22cc3c)

      Ubuntu:
      DropDownMn: aboutToShow()
      DropDownMn: QZOrderChangeEvent(0xbfbc2ea8)
      DropDownMn: QShowEvent(0xbfbc2eec)
      LineEditor: QFocusOutEvent(0xbfbc2eac) 4
      DropDownMn: QShowToParentEvent(0xbfbc2f34)

      Symbian:
      MainWindow: QWindowDeactivateEvent(0x1869e3e8)
      LineEditor: QWindowDeactivateEvent(0x1869e3e8)
      MainWindow: QActivationChangeEvent(0x1869e400)
      QEvent(0x1869e3d0, type = 122)
      LineEditor: QFocusOutEvent(0x1869e364) 3

      Issue 1:
      QMenu::aboutToShow/aboutToHide signals are not sent on Symbian. It should be possible to know when receiving a FocusOut event that the focus is being lost because a menu is opening. aboutToShow should be called before sending zorderchange/focusout/show events.

      Issue 2:
      On Symbian the window of a menu and the window of the parent widget hosting the menu are treated as equal windows. This is totally different to other platforms. The behavior of Qt should be more consistent across platforms. A window shouldn't get deactivated when a menu belonging to the window is opened. If the current behavior is kept then it should at least be possible for the application to conclude that the deactivation is happening due to a menu being opened. Currently there's no way to know that.

      Issue 3:
      The application shouldn't get deactivated when a menu belonging to some of the application's windows is opened (QEvent type 122).

      Issue 4:
      On Symbian, when the focus moves to a menu the QFocusEvent-reason is ActiveWindowFocusReason (3). On other platforms it's PopupFocusReason (4). It should be possible to know when receiving FocusOut event that it's due to a menu being opened.

      Issue 5:
      ShowToParent event is not sent on Symbian when opening a menu.

      Attachments

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

        Activity

          People

            e0101981 Janne Anttila
            suistoma Jussi Suistomaa
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes