Support drags from Widget Explorer onto System Tray
ClosedPublic

Authored by davidedmundson on Oct 31 2016, 11:25 AM.

Details

Summary

Some users complain that applets do not behave like applets in the
system tray, this is because they're not adding them in the system tray.

This makes it a bit more intuitive to add applets to the system tray by
allowing drag and drop of applets with NotificationArea=true into the
system tray.

CCBUG: 358283

Test Plan

Dragged digital clock over system tray
system tray moved and the clock was added to the side

Dragged kate sessions over system tray
on drop, kate sessions applet was added to the tray

Diff Detail

Repository
R120 Plasma Workspace
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
davidedmundson retitled this revision from to Support drags from Widget Explorer onto System Tray.
davidedmundson updated this object.
davidedmundson edited the test plan for this revision. (Show Details)
davidedmundson added a reviewer: Plasma.
Restricted Application added a project: Plasma. · View Herald TranscriptOct 31 2016, 11:25 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik added inline comments.
applets/systemtray/package/contents/ui/main.qml
241 ↗(On Diff #7773)

Can you split that into a function so we then have

onDragEnter: {
    if (!isAcceptableDragEvent(event)) {
        event.ignore()
        return
    }
}
onDrop: {
    if (!isAcceptableDragEvent(event)) {
        event.ignore()
        return
    }
    ...
}
applets/systemtray/systemtray.h
100 ↗(On Diff #7773)

const

Split function for extracting name from event mimedata

mart accepted this revision.Nov 1 2016, 3:31 PM
mart added a reviewer: mart.
mart added a subscriber: mart.

fine for me, one thing is even tough i am not sure if there is any systray plasmoid accepting drops at the moment, probably not.. but how would behave in that case? the internal drop area of the plasmoid should eat all the events i think (and the current implementation should do it)
may be worth to test

This revision is now accepted and ready to land.Nov 1 2016, 3:31 PM

but how would behave in that case? the internal drop area of the plasmoid should eat all the events i think (and the current implementation should do it)

may be worth to test

It should be completely unaffected because we have the explicit event.ignore() if it's dragging anything other than a plasmoid.

If I drag a mimetype containing plain text over the system tray it's still being processed by the panel, alllowing me to drop a note there; so we know that we're not intercepting it.

This revision was automatically updated to reflect the committed changes.