Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.8.2
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
- relates to
-
QTBUG-134249 Qt::Tool and Qt::WA_TransparentForMouseEvents conflicts and behaves inconsistently on different OSes
-
- Reported
-