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

Certain combination of window flag and attribute may conflict on macOS

    XMLWordPrintable

Details

    • macOS

    Description

      It is closely related to
      https://bugreports.qt.io/browse/QTBUG-134249
      that the issue is still "enter/leaveEvent being registered repeatedly like spamming". But it is on macOS only since it involves macos-only attributes.

      Reproducer attached. There is no difference than the one I uploaded for QTBUG-134249, with only 2 lines added:

              setAttribute(Qt::WA_ShowWithoutActivating, true);
              setAttribute(Qt::WA_MacAlwaysShowToolWindow);
      

      and 1 line modified:

      topWidget->setWindowFlags(Qt::FramelessWindowHint | Qt::Tool | Qt::NoDropShadowWindowHint); //It is Qt::Tool only for QTBUG-134249
      

      Run the reproducer as it is, then you can see the same enter/leaveEvent problem. The solution is to remove both Qt::FramelessWindowHint and Qt::NoDropShadowWindowHint, as well as Qt::WA_ShowWithoutActivating and Qt::WA_MacAlwaysShowToolWindow (basically comment out everything at line 15, 16 and 17). Those flags seem to mess up with mouse events.

      Update: a one-line solution: use Qt::Popup instead of Qt::Tool. Given that Tool is Popup | Dialog, may something's off inside Dialog.

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              luqiaochen Luqiao Chen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes