Bug 301723 - Frequent repaints of status icon
Summary: Frequent repaints of status icon
Status: RESOLVED FIXED
Alias: None
Product: Network Management
Classification: Miscellaneous
Component: Plasma Widget (show other bugs)
Version: 0.9
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Sebastian Kügler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-12 11:35 UTC by Eckhart Wörner
Modified: 2012-07-03 15:39 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 0.9.0.3


Attachments
Do not update systray if not needed. (2.01 KB, patch)
2012-06-12 18:23 UTC, Lamarque V. Souza
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eckhart Wörner 2012-06-12 11:35:38 UTC
The network management icon is repainted quite often when a wireless connection is the default connection, ~2-3 times every few seconds. My guess is that changes in wireless signal strength cause the repaint. Note that the icon itself does not change.
This has a negative effect on laptop battery time.

Reproducible: Always

Steps to Reproduce:
1. Connect to a wireless network.
2. Activate the "Show paint area" kwin effect.
3. Wait a few second.
Comment 1 Lamarque V. Souza 2012-06-12 14:51:26 UTC
I activated the "Show paint" effect and the systray icon does not repaint that often here. Actually it only repaint when changing the signal strengh, which does not happen that often either. The Konversation icon is the one that repaints very often here. Maybe it depends on the GPU ou have.
Comment 2 Eckhart Wörner 2012-06-12 18:01:24 UTC
The repaints match the changes in signal strength here as well (checked using dbus-monitor). The problem is that those changes happen every ~2 seconds on my system (maybe that interval depends on the wifi driver).

The real problem is that the icon gets repainted even though it doesn't actually change - most changes in signal strength don't result in a change of icon. If the icon stays the same, this should not result in a repaint, however.
Comment 3 Lamarque V. Souza 2012-06-12 18:23:21 UTC
Created attachment 71772 [details]
Do not update systray if not needed.

Please try this patch and see if it solves this problem.
Comment 4 Lamarque V. Souza 2012-06-12 19:01:46 UTC
Git commit 088e25f575b36e9542c11f19d205f35c27ec0a29 by Lamarque V. Souza.
Committed on 12/06/2012 at 21:00.
Pushed by lvsouza into branch 'master'.

Do not unnecessarily update the systray icon to prevent undesired repaints.

M  +22   -13   applet/networkmanager.cpp
M  +2    -0    applet/networkmanager.h

http://commits.kde.org/networkmanagement/088e25f575b36e9542c11f19d205f35c27ec0a29
Comment 5 Lamarque V. Souza 2012-06-12 19:07:24 UTC
Git commit ad39b3b977ee3a4925573c101fa530c2d2d99cd9 by Lamarque V. Souza.
Committed on 12/06/2012 at 21:00.
Pushed by lvsouza into branch 'nm09'.

Do not unnecessarily update the systray icon to prevent undesired repaints.

M  +13   -3    applet/networkmanager.cpp
M  +2    -0    applet/networkmanager.h

http://commits.kde.org/networkmanagement/ad39b3b977ee3a4925573c101fa530c2d2d99cd9
Comment 6 Lamarque V. Souza 2012-06-12 22:12:25 UTC
Git commit 0dd41b1c9c73382e6e952047b9031c554fde62d5 by Lamarque V. Souza.
Committed on 13/06/2012 at 00:10.
Pushed by lvsouza into branch 'master'.

Update systray icon when required.

M  +48   -2    applet/networkmanager.cpp
M  +13   -0    applet/networkmanager.h

http://commits.kde.org/networkmanagement/0dd41b1c9c73382e6e952047b9031c554fde62d5
Comment 7 Lamarque V. Souza 2012-06-12 22:17:03 UTC
Git commit 087fbd918c89867458f147807c1c30ecaf61f36a by Lamarque V. Souza.
Committed on 13/06/2012 at 00:10.
Pushed by lvsouza into branch 'nm09'.

Update systray icon when required.

M  +48   -2    applet/networkmanager.cpp
M  +13   -0    applet/networkmanager.h

http://commits.kde.org/networkmanagement/087fbd918c89867458f147807c1c30ecaf61f36a
Comment 8 Lamarque V. Souza 2012-06-12 22:25:36 UTC
Git commit cf1dfc2636a7dce9f31e3b6c9e4ad3a92ae2e188 by Lamarque V. Souza.
Committed on 13/06/2012 at 00:22.
Pushed by lvsouza into branch 'master'.

Small optimization.

M  +0    -8    applet/networkmanager.cpp

http://commits.kde.org/networkmanagement/cf1dfc2636a7dce9f31e3b6c9e4ad3a92ae2e188
Comment 9 Lamarque V. Souza 2012-06-12 22:26:20 UTC
Git commit 5047db0d97d00ca802fcdf1c4645a73bfc6851ed by Lamarque V. Souza.
Committed on 13/06/2012 at 00:22.
Pushed by lvsouza into branch 'nm09'.

Small optimization.
(cherry picked from commit cf1dfc2636a7dce9f31e3b6c9e4ad3a92ae2e188)

M  +0    -8    applet/networkmanager.cpp

http://commits.kde.org/networkmanagement/5047db0d97d00ca802fcdf1c4645a73bfc6851ed
Comment 10 Eckhart Wörner 2012-06-14 14:52:12 UTC
I retried using nm09 branch. Unfortunately, the problem is not completely gone, it just went from "a bunch of repaints per signal change" to "one repaint per signal change".
Comment 11 Lamarque V. Souza 2012-06-14 15:00:07 UTC
If the ap's signal strength changes the icon then I need to update the icon, so there is nothing more I can do about this problem. Unless you want me to add an option to use a static icon like the one for wired connections. That way the icon will never change (at least not until the connection changes or an overlay must be applied).
Comment 12 Eckhart Wörner 2012-06-14 15:04:25 UTC
There seems to be a misunderstanding. There is still one repaint per signal strength change even though the icon itself doesn't change.
Comment 13 Lamarque V. Souza 2012-06-14 15:41:18 UTC
Git commit 3e3c88ad00226b40cf50dd47106ee383c17f1da9 by Lamarque V. Souza.
Committed on 14/06/2012 at 17:40.
Pushed by lvsouza into branch 'master'.

Avoid unneeded repaints when updating systray overlay.

M  +6    -1    applet/networkmanager.cpp

http://commits.kde.org/networkmanagement/3e3c88ad00226b40cf50dd47106ee383c17f1da9
Comment 14 Lamarque V. Souza 2012-06-14 15:43:06 UTC
Git commit 822f45632632dd90b43751aa281f60572e11375f by Lamarque V. Souza.
Committed on 14/06/2012 at 17:40.
Pushed by lvsouza into branch 'nm09'.

Avoid unneeded repaints when updating systray overlay.
(cherry picked from commit 3e3c88ad00226b40cf50dd47106ee383c17f1da9)

M  +6    -1    applet/networkmanager.cpp

http://commits.kde.org/networkmanagement/822f45632632dd90b43751aa281f60572e11375f
Comment 15 Eckhart Wörner 2012-06-15 20:55:15 UTC
There's something wrong with repaints now. With the latest changes there are no repaints anymore, even when the signal strength crosses the 70% limit (checked by running dbus-monitor --system in parallel). The new icon only gets painted when I click on the icon to open/close the widget.
Comment 16 Lamarque V. Souza 2012-06-15 21:16:32 UTC
Well, here it works for me. When my wifi ap changes the signal strength the systray icon changes here (when it should) and is painted correctly. Notice that the icon only changes if the signal strength crosses the limits: 13 | 30 | 50 | 70 | 90. For instance, if the signal strength changes from 89 to 70 the icon stays the same.

The last commit just avoids calling QGraphicsWidget::update() when there is no change in the system tray's overlay icon. The commit does not affect the signal strengh icon per si, only the overlay icon.
Comment 17 Lamarque V. Souza 2012-06-22 00:21:14 UTC
It seems to be working Ok here. I will close this bug.
Comment 18 Eckhart Wörner 2012-06-22 16:40:09 UTC
Comment #15 still seems to be present, I'll open a new bug for that one later.
Comment 19 Lamarque V. Souza 2012-06-22 16:47:25 UTC
I prefer not to add a new bug entry if it is regression caused by change to fix this bug. Anyway, the icon is correctly updated here, have you read my comment #16? The icon does not change all the time, only when the signal strengh transpass one of the values I wrote in comment #16. If the signal strengtt is in beetween 70 and 89 then the icon is not going to change, that is the correct behaviour.
Comment 20 Eckhart Wörner 2012-06-22 18:43:21 UTC
I've read comment #16, that's not the problem. My signal strength passes 70% quite often (I verified this via dbus-monitor).
However, after adding some debug info, it looks like paintInterface is not called when the access point signal strength changes, but when I click on the icon.
(Any chance only the 0.9 branch is affected?)
Comment 21 Lamarque V. Souza 2012-06-22 19:29:57 UTC
This part of the source code is the same for master and nm09 branches. I have just checked here and the icon changes here for nm09 as well.
Comment 22 Eckhart Wörner 2012-07-03 15:39:17 UTC
A hunch: I have the feeling the wireless icon gets repainted when the mobile broadband signal strength changes, will do some proper testing later.