[klipper] Move notification from tray to Klipper
ClosedPublic

Authored by graesslin on Oct 5 2016, 7:12 AM.

Details

Summary

Klipper shows a notification when the shortcuts next/prev history item
gets triggered. This notification used to be implemented in the class
KlipperTray. With the switch from SNI based clipper to a Plasmoid the
notification got lost as the Plasmoid doesn't use the KlipperTray class
at all.

This change moves the notification handling from KlipperTray to Klipper
so that it gets emitted for both SNI and Plasmoid based klipper.

BUG: 368808
FIXED-IN: 5.8.1

Test Plan

Set the shortcuts, triggered them and verified the notification gets shown.

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.
graesslin updated this revision to Diff 7107.Oct 5 2016, 7:12 AM
graesslin retitled this revision from to [klipper] Move notification from tray to Klipper.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added a reviewer: Plasma.
Restricted Application added a project: Plasma. · View Herald TranscriptOct 5 2016, 7:12 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik added a subscriber: broulik.Oct 5 2016, 8:39 AM

If there isn't an option for that already (haven't checked) might make sense to turn that notification into a proper notifyrc event, so the user can turn the notification off. (separate to this patch, obviously)

klipper/klipper.cpp
239

There's an overload that takes a QString iconName which avoids hardcoding the icon size and sending a pixmap over dbus.

i have applied that patch atop of plasma 5.8.0 and see the following problem: When using the shortcut multiple times, the messages get grouped, i.e. shown in a single popup. This causes the most relevant text to be hidden and you need to scroll down to actually see it (see attached screenshot for an example):

The behavior of KDE4 was better: it only shows a single message at once, removing any previous messages.

another minor issue: the notification symbol/icon is blurred and the old one from KDE 4 times.

Looks like a bug in the notification service, at least looking at the code it should reuse the notification. :/

If there isn't an option for that already (haven't checked) might make sense to turn that notification into a proper notifyrc event, so the user can turn the notification off. (separate to this patch, obviously)

Just checked. Looks like there is none yet. Yes might make sense, but is 5.9 material.

graesslin updated this revision to Diff 7130.Oct 6 2016, 6:34 AM

Use the KNotification::event overload which takes the icon name

another minor issue: the notification symbol/icon is blurred and the old one from KDE 4 times.

That problem should be addressed with the updated version. It no longer sends a 16x16 icon.

mart added a subscriber: mart.Oct 6 2016, 8:51 AM

should be ok now with D2954 ?

sebas accepted this revision.Oct 6 2016, 10:22 AM
sebas added a reviewer: sebas.
This revision is now accepted and ready to land.Oct 6 2016, 10:22 AM
This revision was automatically updated to reflect the committed changes.

just a short feedback: tested the patches together with D2954 and everything works as expected

tillschafer added a comment.EditedOct 6 2016, 11:42 AM

hmm, another small thing: the timeout of the message is about 15 seconds, which is quite long. This is especially long since you just need a short feedback of an action you are actively doing. I.e. in comparison of a message that pops up asynchronously from your workflow you do not have to move your focus from you current task to the notification.

-> i suggest something in the range of 3-5 second