tray icon ignores left mouse click in plasma5

Bug #1553269 reported by Zen25000
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Onboard
Fix Released
Undecided
Unassigned

Bug Description

Hi,
After several years of no problems with onboard in Mageia (Cauldron), we now have KDE Plasma 5 :\

The tray icon when clicked with any mouse button does nothing.

Setting the floating icon active and using that works, however the icon has always worked previously. (Using GTK input method)

During testing with settings from a previous Mageia version it did work from the centre button, but after removing all onboard configs and re-installing it none work.

There is no problem in a MATE install (on arm) where I have also tested the same version. This works correctly from the left mouse button.

Version is onboard-1.2.0

Cheers,
Barry

Revision history for this message
marmuta (marmuta) wrote :

Hi Barry,

> During testing with settings from a previous Mageia version it
> did work from the centre button, but after removing all onboard
> configs and re-installing it none work.
Is the Status Icon provider still set to "AppIndicator"? I had added that setting to the General page in preferences for 1.2.0 since others struggled with it as well. If yes, when you start Onboard from terminal, are there any warnings about AppIndicator3 missing?

> There is no problem in a MATE install (on arm) where I have also tested the
> same version. This works correctly from the left mouse button.
Same here in MATE, but only with Status Icon provider set to "GtkStatusIcon". I fixed that right before the release. There are three versions of that menu positioning code now :/.

I'm currently trying on Ubuntu with Plasma 5.4.3. Set to "AppIndicator", I can middle click to show/hide as usual. With GtkStatusIcon, there is no icon at all and not even an empty place holder. I don't see some other application's status icons either, so this may mean KDE has dropped GtkStatusIcon support too, not sure.

Revision history for this message
Zen25000 (zen25000) wrote :

Hi,
> Is the Status Icon provider still set to "AppIndicator"?
It was not but it is now, and it now works from centre button, in the same way it used to work from the left button.

There are no appindicator messages in terminal only this:
[baz@localhost ~]$ onboard

(onboard:3670): Gtk-WARNING **: Theme directory of theme oxygen has no size field

>Same here in MATE, but only with Status Icon provider set to "GtkStatusIcon". I fixed that right before the release. There are
> three versions of that menu positioning code now :/.

Yes in MATE it needs GtkStatusIcon, however with Appindicator it offers the context menu on both left and right buttons which both work.
This could be an issue where some people use multiple desktops :\

Running with -ddebug the output (with Appindicator set) is attached - maybe it will shed some light ;)

Revision history for this message
marmuta (marmuta) wrote :

I know there 's a usability issue with differing behavior between GtkStatusIcon and AppIndicator, but what can we do? AppIndicator's behavior is hard-coded. All I could do is make GtkStatusIcon behave like AppIndicator, i.e. middle click to show/hide. But left click to show/hide was a major reason to use GtkStatusIcon in the first place. So what do?

For people using multiple desktops I could perhaps add an "auto" option to status icon provider. You'd get GtkStatusIcon in MATE, etc. and AppIndicator in KDE and elsewhere. There should actually be a third option, since we have a rudimentary shell extension for GNOME shell now.

Problem is that auto-detection would not only have to figure out the type of desktop environment, but also its version, since the right choice tends to change over time, with most DEs gravitating towards AppIndicator. Probably still doable somehow, though.

Still, pretty messy all that, only to get some click-able rectangle on screen to show/hide Onboard. I'm wondering if we shouldn't focus more on the floating icon instead. We can do what we want with that one and it works consistently across desktops. I understand people don't really like to use it, but perhaps that can be changed. I'm not a designer, but I think I could improve it a bit.

Revision history for this message
Zen25000 (zen25000) wrote :

I really don't know as I'm not a programmer. It seems to me that KDE have thrown a real spanner in the works with the changes to the system tray in plasma5.

To my simplistic understanding ( or lack of ) it would seem trivial to assign an action to a different button - but apparently not.

I have packaged the gnome-shell extension separately but it creates another issue. The shell extension package pulls in an extra 160 gnome packages on a KDE system if it is recommended by onboard.
https://bugs.mageia.org/show_bug.cgi?id=17799

I 'sort-of' worked around the tray issue in KDE by positioning the floating icon on top of the tray icon and shrinking it to the same size. This now displays the black/white icon when the keyboard is disabled and the coloured one when enabled. This now mimics the original left click behaviour.

I am sure that you will give all of this more thought and maybe come up with a better workaround :)

I also asked a question that is confusing me regarding qtatspi-plugin, however it seems that I maybe asked in the wrong place:
https://answers.launchpad.net/ubuntu/+source/onboard/+question/287311
Perhaps you could take a look?

Barry

Revision history for this message
marmuta (marmuta) wrote :

The gnome-shell extension is not installed by default on Ubuntu. We haven't solved the dependency problem either, so it's only a suggests dependency of Onboard. Basically, currently we leave it to the users to discover and install it. It really makes only sense when gnome-shell is installed. I suspect on Mageia it shouldn't be installed with Onboard either.

Perhaps we can improve on this later, e.g. by simply not depending on anything from gnome-shell at all and creating the shell's extension directories only for Onboard. Or we install the extension on demand with a checkbox in preferences. Not sure yet.

Here's some good news, I figured out how to get a status icon in KDE that can be left clicked. I've learned that the limitations of AppIndicator don't exist in the underlying D-Bus spec. If you bypass AI there is a convenient Activate() method, neat.
https://www.freedesktop.org/wiki/Specifications/StatusNotifierItem
There's no additional KDE dependency necessary either, since everything runs over D-Bus.

The prototype is in trunk if you want to try it. Set status icon provider to "StatusNotifier" in preferences. It's not quite finished yet, the menu is still missing, but clicking works here.

I'll see what I can find out for question #287311. I can't answer it from the top of my head.

Revision history for this message
Zen25000 (zen25000) wrote :

Excellent - that works a treat at 2119 \o/

I knew you could do it :)

OK on the shell extension - we will just not recommend it as you say and let users find the package for now.

Zen25000 (zen25000)
summary: - tray icon ignores all mouse clicks in plasma5
+ tray icon ignores left mouse click in plasma5
Revision history for this message
marmuta (marmuta) wrote :

Glad you liked it :), but I had to throw it out again. Adding that missing menu to the StatusNotifier turned out to be a huge headache. I spent way too much time on this, but finally gave up and killed it. But, fear not, there is now a hack in place for the AppIndicator provider that catches the Activate message.

Basically , whenever you get the latest Onboard, make sure status icon provider is back to the default "AppIndicator". In KDE Plasma you should then still be able to left click the indicator. Maybe elsewhere too, but not in Unity, as they don't send the Activate() message there.

Changed in onboard:
status: New → Fix Committed
Revision history for this message
Zen25000 (zen25000) wrote :

I just built a package from trunk, and installed it in a fresh install of Mageia Cauldron KDE plasma5 (from a development install iso).
It's working great and has the menu back.
I will check it in another installation with MATE and LXDE.

Sorry to have caused you so much work, but the result is worth it I assure you - well done!

Will there be a new release soon or should I just patch up to current trunk on top of 1.2.0?

Cheers,
Barry

Revision history for this message
marmuta (marmuta) wrote :

Excellent, thank you.
There could be a minor release, right. You probably want rev. 2110 too. Let me talk to Francesco.

Revision history for this message
Zen25000 (zen25000) wrote :

I tested in MATE and it works, but only after a reboot, initially there was no tray icon at all, and I used the floating one.

After reboot the tray icon appeared and works fine (with GTKstatusicon set)

The icon in MATE seems to not be displayed transparently as it is in Plasma5. Photo attached

Cheers,
Barry

Revision history for this message
marmuta (marmuta) wrote :

Hmm, not here on Ubuntu Xenial, see screen shot. The new 24x24 icon I painted definitely has a transparent background. There are other icons with that dark background too in your image, maybe there's a difference in configurations. I know too little about MATE to make a good guess, though.

And MATE still has to be configured to use GtkStatusIcon, AppIndicator simply shows no icon at all. I can't explain why you needed to reboot, restarting Onboard is enough here when changing the status icon provider. There is no auto-detection yet, but I was planning to look into it. There are other loose ends I have to pick up first, though.

Revision history for this message
Zen25000 (zen25000) wrote :

Yes I noticed the other icons as well so it's probably something in our MATE that still needs fixing - it's still Cauldron after all.
Not to worry for now it may all sort itself as we get into the RC releases.
I was wondering if the DE could be detected in onboard to set the status icon provider? I was considering detection in the onboard install to set it, but of course some people could have MATE and Plasma installed on one system, so that was not really practical. It really needs to happen at program start. Unless we made a start script to do the switch - but that's messy!

Revision history for this message
marmuta (marmuta) wrote :

I've added auto-detection for status-icon-provider. Switch to the new default value "Auto-detect" in preferences. It relies on XDG_CURRENT_DESKTOP and/or DESKTOP_SESSION being set properly. This seems to be the case in Ubuntu everywhere I looked, but I'm not sure about Mageia. Could you check?

It's currently set up to pick GtkStatusIcon for Cinnamon, MATE and XFCE. Those would need to be checked. Everywhere else should be fine, as it then falls back to AppIndicator.

BTW, I found no other DE but KDE where the left click on AppIndicator works.

Revision history for this message
marmuta (marmuta) wrote :

Oh, you need to know how. Boot into those three (or fewer if not all are available) DEs and run
onboard -ddebug

The detected DE is printed close to the beginning:
20:59:46.737 DEBUG Config Desktop environment: Unity

Further down is the final status icon provider:
21:00:25.585 INFO Indicator Status icon provider: 'BackendAppIndicator' selected

Cinnamon, MATE and XFCE should show BackendGtkStatusIcon, everyone else BackendAppIndicator.

Revision history for this message
Zen25000 (zen25000) wrote :

Looks good :)

Testing in KDE and Mate works fine with Auto-detect set manually in the GUI.

 We create a custom onboard-defaults.conf in the rpm spec - is the correct syntax for the status icon setting:

status-icon-provider=AutoDetect

I am not sure whether it needs a '-' or not, and whether the case is correct?

I will test some more DEs later.

Revision history for this message
Zen25000 (zen25000) wrote :

I have tried:
AutoDetect
Auto-Detect
Auto Detect
auto-detect
autodetect
Auto
...and finally:
auto \o/

Not what I expected at all as all the other parameters are capitalized :\

Revision history for this message
Zen25000 (zen25000) wrote :

OK I have done more testing and it seems OK except for LXDE / LXQt which are auto selecting Appindicator when they should be Gtk.
The LXDE DE is detected correctly, but LXQt is unknown.
I did not check XFCE as I don't have it installed.

Revision history for this message
Zen25000 (zen25000) wrote :

Just installed XFCE and that is correctly detected and works OK too - BackendGtkStatusIcon selected.
Now bed!

Revision history for this message
marmuta (marmuta) wrote :

Thanks you for all the testing!

> We create a custom onboard-defaults.conf in the rpm spec - is the correct syntax for the status > icon setting:
> status-icon-provider=AutoDetect
status-icon-provider=auto

"auto" is the default, though. There's no need to add it to onboard-defaults.conf.

> ...and finally:
> auto \o/
Run dconf-editor and navigate to org.onboard status-icon-provider. It shows you a list of possible values for enums, no need to guess. Or look at the schema source data/org.onboard.gschema.xml. I try to keep enums lower-case and short and there might be more than one "auto" key in the future. They'll all get the same "auto" value. The upper case enum values like GtkStatusIcon are exceptions, actually.

> OK I have done more testing and it seems OK except for LXDE / LXQt which
> are auto selecting Appindicator when they should be Gtk.
Thanks, I've added LXQt to the DE detection. What's wrong with AppIndicator there? Here in LXDE the GtkStatusIcon is placed in a kind of legacy tray with tiny icons, while AI is normal sized. In LXQt both seem to work just as well, AppIndicator can even be left clicked there (left click works in KDE and LXQt now!). When in doubt, I'd rather go with the newer AppIndicator. It still falls back to GtkStatusIcon if AppIndicator isn't installed.

Revision history for this message
marmuta (marmuta) wrote :

Since "auto" is the default you can also run

gsettings reset org.onboard status-icon-provider

to return to "auto".

> It still falls back to GtkStatusIcon if AppIndicator isn't installed.
OK, it didn't, but now it does :)

Revision history for this message
Zen25000 (zen25000) wrote :

    Revision 2128
    Nothing in onboard-defaults.conf about status icon now.

    LXDE
    20:59:39.287 DEBUG Config Desktop environment: LXDE
    20:59:39.570 INFO Indicator Status icon provider: 'BackendAppIndicator' selected
    Left or right buttons show menu.
    GUI shows Auto.
    Switching to GTK works fine

    LXQt
    21:08:51.227 DEBUG Config Desktop environment: LXQT
    21:08:51.557 INFO Indicator Status icon provider: 'BackendAppIndicator' selected
    Left or right buttons show menu.
    GUI shows Auto.
    Switching to GTK works fine

    No idea why we are seeing a different result to you in LXDE and LXQt :\

Revision history for this message
marmuta (marmuta) wrote :

LXQt not supporting left click is surprising. I thought it sending Activate made sense, because it was based on Qt 5.0. lxqt-about shows
Version 0.10.0
Qt 5.5.1

Well, time for plan B then. I'll make it configurable per desktop. That way you can change the defaults in onboard-defaults.conf.

Revision history for this message
Zen25000 (zen25000) wrote :

Ah, this may be the difference:
From About LXQt:
Version
0.10.0
Qt
5.6.0

Is there anything I can test here to indicate if this is the case?

Revision history for this message
marmuta (marmuta) wrote :

dbus-monitor --session path=/org/ayatana/NotificationItem/Onboard

middle click on AppIndicator in LXQt gives:
method call time=1458226181.922776 sender=:1.34 -> destination=:1.124 serial=2103 path=/org/ayatana/NotificationItem/Onboard; interface=org.kde.StatusNotifierItem; member=SecondaryActivate
   int32 1201
   int32 751

left click:
method call time=1458226366.535446 sender=:1.34 -> destination=:1.124 serial=2537 path=/org/ayatana/NotificationItem/Onboard; interface=org.kde.StatusNotifierItem; member=Activate
   int32 1201
   int32 749

Revision history for this message
Zen25000 (zen25000) wrote :

Sorry for the delay - I missed the notification - then Easter.

In LXQt I can currently not get any icon to appear, but in LXDE there is no output from dbus-monitor when clicking any button, irrespective of Status Icon provider setting.

LXDE
The output on launch of dbus-monitor is:
[baz@jackodesktop ~]$ dbus-monitor --session path=/org/ayatana/NotificationItem/Onboard
signal time=1459282117.583950 sender=org.freedesktop.DBus -> destination=:1.97 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.97"
signal time=1459282117.583970 sender=org.freedesktop.DBus -> destination=:1.97 serial=4 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
   string ":1.97"

Also no button does anything when using AppIndicator or Auto.
It works correctly using GtkStatusIcon (no output from dbus-monitor).

I will log back into LXQt and see if the icon has appeared now that I have GTK set.

Revision history for this message
Zen25000 (zen25000) wrote :

> Also no button does anything when using AppIndicator or Auto.
> It works correctly using GtkStatusIcon (no output from dbus-monitor).

Ignore the above part of the previous post.

Corrected here:

With Auto set, Left and Right clicks open the menu, and TWO middle clicks open the keyboard.

With AppIndicator set Left and right clicks are the same (menu) but middle click seems to increase by one each time up to 12 clicks required to open the kbd , then it stays constant-ish - strange.

With GtkStatusIcon Left click opens keyboard, right click opens menu and middle button does nothing (all correct)

All above and in previous post with rev.2128

I have given up trying to test in LXQt for now as the systray is too broken in Cauldron at the moment.

Revision history for this message
marmuta (marmuta) wrote :

> and TWO middle clicks open the keyboard
Interesting, that's a first.

I'm still planning to make status-icon-provider configurable per DE. Then you can change it to your needs in onboard-defaults.conf.

Question is, how? There's a simple way that can be done in an hour, but doesn't scale well in case there are any other DE dependent settings. I might do that temporarily, but I think ultimately we need a better approach that more naturally supports DE, user and profile dependent settings.

marmuta (marmuta)
Changed in onboard:
status: Fix Committed → Fix Released
Revision history for this message
marmuta (marmuta) wrote :

Just released Onboard 1.3.0 comes with the left click on tray fix and the other stuff we discussed. No progress on #27 yet, sorry, but it's still on my list.

https://bugs.launchpad.net/bugs/1613063

Revision history for this message
Zen25000 (zen25000) wrote :

Thanks that's great - it should just get into Mageia 6 which is in version freeze, so you timed it well. :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.