[Notifications] Use custom DragHelper instead of Qt's Drag attached property
ClosedPublic

Authored by broulik on Jan 9 2018, 10:21 AM.

Details

Summary

Qt's Drag attached property doesn't like it at all when it gets deleted during drag.
Even though we try very hard to keep the popup open, when you have multiple notification applets, their dialogs don't know each other but access a shared data engine. This means that, since there can only we one hovered dialog at a time, another notification applet might still dismiss the notification and have our dialog close.
By using a singleton NotificationHelper we 1.) decouple the Drag from the item and 2.) share the "is dragging" state between applets.

BUG: 388684
FIXED-IN: 5.12.0

Test Plan

DragHelper taken from Kicker and adjusted

  • Added two notification applets, took a screenshot, dragged the screenshot of a notification, waited a bit, notification stayed open. Previously it would still close and then crash
  • left click to open thumbnail still works
  • Right click for context menu still works
  • We get a nice drag pixmap now, the original code with using the QPixmapItem as drag source never worked apparently

Diff Detail

Repository
R120 Plasma Workspace
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.Jan 9 2018, 10:21 AM
Restricted Application added a project: Plasma. · View Herald TranscriptJan 9 2018, 10:21 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Jan 9 2018, 10:21 AM

You know my rule by now. If we're working round a Qt bug, we should have a Qt bug report.

applets/notifications/plugin/draghelper.cpp
51

sycoca change?

64

This leaks drags over the lifespan of the item, not deleting after drop.

81

:/ really?

This revision was not accepted when it landed; it landed in state Needs Review.Jan 11 2018, 1:02 PM
This revision was automatically updated to reflect the committed changes.