system tray work
Aurélien Gâteau
agateau at kde.org
Fri May 7 16:49:42 CEST 2010
On 02/05/2010 23:36, Fredrik Höglund wrote:
> On Thursday 29 April 2010, Aaron J. Seigo wrote:
>> On April 29, 2010, Marco Martin wrote:
>>> i think i like more the second option.
>>> the only problem is that the ui for it would be rather clunky (there would
>>> be two distinct shortcut configurations in 2 different places that do
>>> almost the same thing)
>>
>> yes, a little clunky. perhaps room for improvement in the future. bonus points
>> for working with any entry in the system tray though ;)
>>
>> which reminds me: someday we really ought to implement some keyboard
>> navigation :)
>
> I like this option as well. Keyboard shortcuts are important for
> accessability, so this is something that really should work with all
> icons and not just with klipper.
>
> Anyway, I've attached the current version of the Klipper patch.
> Aside from the keyboard shortcut there's also the issue that the
> dbus menu isn't always updated when the clipboard history changes.
> Sometimes it is, sometimes it isn't.
>
> I'm hoping Aurélien has some idea about that.
I just had a look at it, and could not reproduce it :/. Do you know of a
way to reliably reproduce it?
About the patch: I noticed that left-click shows the menu directly
instead of going through dbusmenu, which is a bit inconsistent (even if
it's nice for testing!). I tried to improve it by replacing the code in
tray.cpp like this:
diff --git a/workspace/klipper/tray.cpp b/workspace/klipper/tray.cpp
index e392698..7c02e45 100644
--- a/workspace/klipper/tray.cpp
+++ b/workspace/klipper/tray.cpp
@@ -43,8 +43,7 @@ KlipperTray::KlipperTray()
setStatus( Active );
setStandardActionsEnabled( false );
setContextMenu( m_klipper->history()->popup() );
- connect( this, SIGNAL( activateRequested( bool, QPoint )), m_klipper,
- SLOT( slotPopupMenu( bool, QPoint)));
+ setAssociatedWidget( m_klipper->history()->popup() );
connect( m_klipper->history(), SIGNAL(changed()),
SLOT(slotSetToolTipFromHistory()));
slotSetToolTipFromHistory();
connect( m_klipper, SIGNAL(passivePopup(QString,QString)),
SLOT(passive_popup(QString,QString)));
(Calling setAssociatedWidget() on the menu is a little-known feature of
KSNI which causes the left-click to trigger the menu)
But it's not enough because KStatusNotifierItem shows the menu itself
instead of sending a menu request over DBus. Which is understandable
because there is currently no way to send a menu request. This would be
a good addition in my opinion, what do you think about this?
Aurélien
More information about the Plasma-devel
mailing list