[Dialog] Don't forward hover event when there is nowhere to forward it to
ClosedPublic

Authored by broulik on Apr 2 2019, 10:26 AM.

Details

Summary

Dialog has this clever way of re-sending a mouse event inside the bounardies of the dialog, so despite visual padding, the items can be clicked on any corner following Fitt's law.
However, when the mainItem has no size, adjusting the position will adjust it inside the border since there is no pixel inside the main item, leading to infinite recursion as the event is processed again and again and again leading to a crash.

Test Plan

Opened a Dialog with a mainItem without a width, dialog showed up tiny, hovered it, no longer crashed
Verified that event is still forwarded in the normal case.

I bet there's a tonne of crash reports like this (crash in Dialog::event in recursion) on bugzilla since an empty dialog could happen in case of a failure to load some QML bits.

Diff Detail

Repository
R242 Plasma Framework (Library)
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Apr 2 2019, 10:26 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptApr 2 2019, 10:26 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
broulik requested review of this revision.Apr 2 2019, 10:26 AM
davidedmundson accepted this revision.Apr 2 2019, 11:18 AM
davidedmundson added a subscriber: davidedmundson.

We have a bug report about infinite loop in the notifications.

This revision is now accepted and ready to land.Apr 2 2019, 11:18 AM
This revision was automatically updated to reflect the committed changes.