Bug 301424 - Cannot open battery monitor applet if set to hidden in systray
Summary: Cannot open battery monitor applet if set to hidden in systray
Status: RESOLVED UNMAINTAINED
Alias: None
Product: plasma4
Classification: Plasma
Component: widget-systemtray (show other bugs)
Version: 4.9.90 Beta2
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: regression
: 307454 307865 316709 325991 327606 335135 338952 344845 351665 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-06-08 07:38 UTC by Maarten De Meyer
Modified: 2018-06-08 18:33 UTC (History)
24 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maarten De Meyer 2012-06-08 07:38:00 UTC
I have the battery monitor applet set to always hidden in the system tray. When extending all items and left clicking nothing happens. Right click and the tooltip work.

Reproducible: Always

Steps to Reproduce:
1. Set systemtray settings to always hide the battery aplet
2. Expand systemtray
3. Click battery
Actual Results:  
Nothing

Expected Results:  
The battery monitor opens
Comment 1 Anne-Marie Mahfouf 2012-06-08 07:49:28 UTC
Confirmed. Is it a regression (meaning it worked in 4.8 series)?
Comment 2 Maarten De Meyer 2012-06-08 08:47:47 UTC
Yes. I just tested it on a 4.8 system.
Comment 3 Anne-Marie Mahfouf 2012-06-08 08:53:09 UTC
Marked as regression, thanks a lot Maarten!
Comment 4 Viranch Mehta 2012-06-08 22:34:20 UTC
This is not the battery applet's problem. This has something to do with the way applet popups are implemented in general. Probably the combination of such implementation and setting the applet always hidden in tray gives rise to the bug.

Not sure if this is a problem of widget-systemtray enough to reassign to it.
Comment 5 Thijs 2012-06-22 08:41:28 UTC
Definitely not a battery bug, may be a systray bug - so reassigning it indeed.
Comment 6 Benjamin M 2012-08-31 09:59:20 UTC
Idk if this matters anymore, but I confirm on 4.9.0, openSUSE packages.
Comment 7 Ralf Jung 2012-09-13 19:03:47 UTC
I have the same issue, however I believe it is battery applet specific:
* It also happens if the battery applet is set to auto, so it's definitely unrelated to setting it to always hidden. On my system, it just depends on whether the icon is hidden or shown, not why.
* The auto-hidden device applet works all right.
* Setting the network applet to always hidden, is also works all right.
Comment 8 Maarten De Meyer 2012-10-28 05:55:09 UTC
*** Bug 307865 has been marked as a duplicate of this bug. ***
Comment 9 Maarten De Meyer 2012-10-28 05:56:55 UTC
Update: Clicking the battery icon works. It is only the text that does not open the applet.
(see duplicate)
You can use that as a workaround.
Comment 10 Jekyll Wu 2012-10-29 22:01:06 UTC
*** Bug 307454 has been marked as a duplicate of this bug. ***
Comment 11 J.A. Moray 2012-11-14 21:25:17 UTC
I use a PC (I have no battery) but I use this applet to disable power management when I'm going to watch long videos or a streaming in the web browser and it happens to me too. Happens only when its hidden.

I hope it will be fixed soon. But, as Maraten De Meyer said (thanks), if you click in the icon, nor the text, it works, so that will do the trick until it's fixed.
Comment 12 Søren Holm 2012-12-04 20:15:11 UTC
I can confirm this bug on 4.9.80 also. The icon works but the text doesn't
Comment 13 Anne-Marie Mahfouf 2012-12-05 12:06:33 UTC
Viranch it works with hidden Device Notifier (text) and Nepomuk  but not with hidden Battery Monitor text. This is a very annoying bug.
Comment 14 Viranch Mehta 2012-12-05 12:13:07 UTC
(In reply to comment #13)
> Viranch it works with hidden Device Notifier (text) and Nepomuk  but not
> with hidden Battery Monitor text. This is a very annoying bug.

As I noted earlier, this is not a plasmoid specific bug. The plasmoid uses a special way of showing the tray icon which is not used (yet) by any other plasmoid and whose implementation is not a part of the plasmoid.

The reason for using such a way is that the icon for this plasmoid is dynamically built at runtime based on battery percentage, while other plasmoids like device notifier and nepomuk have constant static icons.

In short, the bug is in that implementation. Marco had implemented this AFAIK, so he might be the right person to ask.
Comment 15 Ralf Jung 2013-03-10 19:29:41 UTC
This bug is still present in KDE 4.10.1.
Comment 16 Kyle 2013-03-19 15:24:46 UTC
Still present in 4.10.1 here too.
Comment 17 Ralf Jung 2013-04-06 20:09:41 UTC
I digged through the code to find out about the cause of this bug - or, furthermore, to find out why usually, the popup *does* open when clicking the text. Unfortunately, I am stuck: I noticed that the MouseRedirectArea in the IconsList (systemtray/package/contents/ui/IconsList.qml) redirects the text mouse events to the "target". In case of the "widget" items (like the battery manager), the events are forwarded to the task representing the widget, an instance of SystremTray::PlasmoidTask. Here I am stuck, I cannot find out why mouse events sent there somehow end up triggering the popup to open. I would appreciate if whoever works on this code would give me a hint - it already took me 3 hours to find what I got, which is quite frustrating considering that this would probably have been a matter of minutes for someone knowing the code. But it seems nobody is interested in this bug.

I also found out that the bug is related to the compactRepresentation: If I remove the compactRepresentation from batterymonitor.qml, the popup opens correctly. This is why it does not affect the device monitor. Somehow, replacing the icon representation breaks the forwarding from the task to opening the popup of the PopupApplet.
Comment 18 Ralf Jung 2013-04-06 20:42:41 UTC
I think I found the problem:

In popupapplet.cpp, PopupAppletPrivate::createIconWidget, the clicked() signal of the icon is connected to the internalTogglePopup slot of the private part of the PoupApplet. This is the path which is taken when the text is clicked (as I found out via gdb). However, when the compactRepresentation is set up in DeclarativeAppletScript::qmlCreationFinished, nothing is connected. Hence the click is not forwarded to the PopupApplet. Unfortunately, QDeclarativeItem does not have a clicked() signal.
How should this be handled?
Comment 19 rockonthemoonfm 2013-04-21 09:57:24 UTC
bug still present in 4.10
no one wants to fix it? battery widget is plagued with qml bugs, very much beta state.
Comment 20 jack 2013-04-28 06:28:00 UTC
I can confirm this on 4.10.2, but for any non-native KDE system tray icon- not just battery widget
Comment 21 Aaron J. Seigo 2013-05-02 10:17:00 UTC
Ralf: if indeed a signal needs forwarding, then a subclass of DeclarativeItemContainer that emits a signal when it gets a mouseReleaseEvent would be needed.

fwiw, it all works flawlessly here for whatever reason (other than that one needs to click right on the text; the white space is not reactive which is not correct).

i wonder if this is working as expected in master, and just not in 4.10?
Comment 22 Ralf Jung 2013-05-03 20:24:01 UTC
(In reply to comment #21)
> Ralf: if indeed a signal needs forwarding, then a subclass of
> DeclarativeItemContainer that emits a signal when it gets a
> mouseReleaseEvent would be needed.
> 
> fwiw, it all works flawlessly here for whatever reason (other than that one
> needs to click right on the text; the white space is not reactive which is
> not correct).
> 
> i wonder if this is working as expected in master, and just not in 4.10?
I did all the aforementioned experiments in the then-current master. Clicking the text (I even tried hitting a black pixel) does not work either, I have to click the icon.
I just tried again with current master, with no change in behaviour.

Another possibly interesting observation: If I click and drag, I can actually move the battery icon around horizontally - which does not make much sense. I cannot do that with the other icons.
Comment 23 Viranch Mehta 2013-05-04 09:57:13 UTC
> Another possibly interesting observation: If I click and drag, I can
> actually move the battery icon around horizontally - which does not make
> much sense. I cannot do that with the other icons.

This is because the icon is inside a ListView because of support for multiple batteries. Multiple icons won't be showed when in tray, but the ListView is still there with the single item, and hence the battery icon glides.
Comment 24 Kai Uwe Broulik 2013-06-02 18:57:48 UTC
> If I click and drag, I can actually move the battery icon around horizontally - which does not make much sense
I recently fixed that.

> (other than that one needs to click right on the text; the white space is not reactive which is not correct).
It's because the name_item in IconsList.qml doesn't have a width and so only where there's text it's clickable.
Comment 25 Aaron J. Seigo 2013-06-03 12:23:25 UTC
> > (other than that one needs to click right on the text; the white space is not reactive which is not correct).
> It's because the name_item in IconsList.qml doesn't have a width and so only where there's text it's clickable.

I actually fixed this after making that comment :) It works as expected now  ..

In any case ... if anyone can confirm this problem with master, please re-open. Otherwise, I'm seeing this as FIXED. Cheers.
Comment 26 Ralf Jung 2013-06-03 17:35:10 UTC
I updated kdelibs, kde-runtime and kde-workspace to current master. The issue persists.
Comment 27 rockonthemoonfm 2013-07-01 11:38:21 UTC
bug CONFIRMED in 4.11 beta 2.

widget opens only after clicking on icon, not text.
Comment 28 Kai Uwe Broulik 2013-07-01 14:15:50 UTC
Confirmed on 4.11 Beta 2.
I thought maybe using just an Item instead of a ListView if there is only one battery fixes (workarounds) that but given it doesn't work with the print-manager plasmoid either which is just a dumb icon (and should use plasmoid.popupIcon anyway :P). I have to investigate what device notifier does different that makes it work
Comment 29 Kai Uwe Broulik 2013-07-01 14:19:33 UTC
Yes, device notifier just uses popupIcon and this works but when a plasmoid uses a custom CompactRepresentation it doesn't. So I bet it doesnt work with the notification plasmoid either.
Comment 30 rockonthemoonfm 2013-07-02 11:27:32 UTC
no, notifications and device-notifier widgets works as expected when clicking on text while hidden in systray :°
Comment 31 Aaron J. Seigo 2013-07-03 08:51:02 UTC
(In reply to comment #29)
> Yes, device notifier just uses popupIcon and this works but when a plasmoid
> uses a custom CompactRepresentation it doesn't. So I bet it doesnt work with
> the notification plasmoid either.

IIRC it results in a popupEvent being triggered. This is available in QML. See:

http://techbase.kde.org/Development/Tutorials/Plasma/QML/API#Events
Comment 32 Kai Uwe Broulik 2013-07-03 09:15:08 UTC
I just tried, the popupEvent is not fired for the battery monitor when I click the label. Only clicking the icon.
Comment 33 Ralf Jung 2013-07-03 10:28:45 UTC
Did you notice my findings in comment 17 and comment 18? Maybe they are helpful.
Comment 34 Lukáš Tinkl 2013-10-14 08:26:31 UTC
*** Bug 325991 has been marked as a duplicate of this bug. ***
Comment 35 Christoph Feck 2013-10-27 20:05:27 UTC
*** Bug 316709 has been marked as a duplicate of this bug. ***
Comment 36 Christoph Feck 2013-11-30 17:51:43 UTC
*** Bug 327606 has been marked as a duplicate of this bug. ***
Comment 37 Sebastian Kügler 2014-01-02 11:52:39 UTC
This is by the way fixed in Plasma 2. I'm leaving the bug open to track it in out long term maintainance release, will close once Plasma 2 is out (if it isn't closed then).
Comment 38 Timothée Ravier 2014-03-01 22:29:25 UTC
This also affects the new plasma-nm (kdeplasma-applets-plasma-nm 0.9.3.3-1 on Arch Linux). I don't know if the widget was affected before the latest release but I've just noticed it.

> This is by the way fixed in Plasma 2.
Great, I'll wait :D
Comment 39 Christoph Feck 2014-05-21 20:30:20 UTC
*** Bug 335135 has been marked as a duplicate of this bug. ***
Comment 40 NMD 2014-08-05 17:24:15 UTC
I can confirm this on Kubuntu (the most recent version), KDE 4.13.2.

I've been getting it with Workrave, Artha, and the Owncloud client icon, so the suggestion that this is non-native kde apps seems plausible to me too.

I look forward to it being fixed in plasma 2 (when's that likely to work its way here?), the workaround with the icon is handy!
Comment 41 Jan Grulich 2014-09-11 08:06:04 UTC
*** Bug 338952 has been marked as a duplicate of this bug. ***
Comment 42 Christoph Feck 2015-03-04 22:00:22 UTC
*** Bug 344845 has been marked as a duplicate of this bug. ***
Comment 43 Wolfgang Bauer 2015-08-25 09:15:09 UTC
*** Bug 351665 has been marked as a duplicate of this bug. ***
Comment 44 Nate Graham 2018-06-08 18:33:23 UTC
Hello!

This bug report was filed for KDE Plasma 4, which reached end-of-support status in August 2015. KDE Plasma 5's desktop shell has been almost completely rewritten for better performance and usability, so it is likely that this bug has already been resolved in Plasma 5.

Accordingly, we hope you understand why we must close this bug report. If the issue described  here is still present in KDE Plasma 5.12 or later, please feel free to open a new ticket in the "plasmashell" product after reading https://community.kde.org/Get_Involved/Bug_Reporting

If you would like to get involved in KDE's bug triaging effort so that future mass bug closes like this are less likely, please read https://community.kde.org/Get_Involved#Bug_Triaging

Thanks for your understanding!

Nate Graham