Fix clicking outside of preview popups to dismiss them corrupting mouse state
ClosedPublic

Authored by hein on Jun 17 2017, 5:22 AM.

Details

Summary

As a result of refactorings in 5.10, hoveredItem may not reflect the
true cursor position when preview popups become involved. When inter-
acting with an item's associated preview popup, it's still considered
hovered. This needs to be taken into account when processing clicks,
otherwise corrupted mouse state leads e.g. to inadvertendly opening
a folder by clicking outside its preview popup to dismiss it.
BUG:380982

Diff Detail

Repository
R119 Plasma Desktop
Branch
arcpatch-D6247_2
Lint
No Linters Available
Unit
No Unit Test Coverage
hein created this revision.Jun 17 2017, 5:22 AM
Restricted Application added a project: Plasma. · View Herald TranscriptJun 17 2017, 5:22 AM
broulik added inline comments.
containments/desktop/package/contents/ui/FolderItemDelegate.qml
119–120

This check is now superfluous as it's also done in closePopup()

hein added inline comments.Jun 19 2017, 10:01 AM
containments/desktop/package/contents/ui/FolderItemDelegate.qml
119–120

Yeah, but it's minutely faster to check this than do a function call (and the dialog not being open is the common case), it's a little more careful to assume a function body doesn't check, and the function does check because it's just good practice, ... it's redundant but I'd leave it like that.

Hover state is reset fine but now the action buttons don't reappear after the popup is closed unless I start dragging the folder. Just selecting and unselecting does not help, I really need to start a drag (perhaps you break some binding in the delegate?)

1.) Click "popup" button on top left of folder
2.) Click outside of popup so it closes, with this patch the folder is no longer highlighted (which is good)
3.) Hover the folder → the action buttons in the top left of the folder don't show anymore, they still work on other folders. So some state still isn't correctly reset.

hein updated this revision to Diff 15668.Jun 20 2017, 8:51 PM
  • Don't break the popupDialog binding. It's a super binding, really, and this patch didn't know how to appreciate it properly.
  • Opening the popup should imply selecting, it avoids other state weirdness in double-click-to-open mode.
hein updated this revision to Diff 15778.Jun 23 2017, 10:20 AM

Drop unrelated TM changes from patch.

broulik accepted this revision.Jun 23 2017, 10:24 AM
This revision is now accepted and ready to land.Jun 23 2017, 10:24 AM
hein updated this revision to Diff 15779.Jun 23 2017, 10:30 AM

Hide the popup button in nested views.

hein requested review of this revision.Jun 23 2017, 10:30 AM
hein edited edge metadata.
broulik accepted this revision.Jun 23 2017, 10:35 AM
This revision is now accepted and ready to land.Jun 23 2017, 10:35 AM
This revision was automatically updated to reflect the committed changes.