! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Use g_timeout_add_seconds for less wake-ups
Status:
RESOLVED: FIXED
Product:
Xfce4-wavelan-plugin
Component:
General

Comments

Description Morten 2009-04-02 12:05:04 CEST
Created attachment 2269 
Use g_timeout_add_seconds on glib version >=2.14

The wawelan panel plugin is often used on laptops. Wavlan wakes up every 250 ms with no syncronations towards other processes causing the kernel to wake up uneeded an increasing powercomsomption. 

Now this plugin is used on laptops and as a user I do want to see the current
lan performance, but not with the cost of worse battery life. So I added a patch that uses g_timeout_add_seconds().

From glib documentation on g_timeout_add (); If you want to have a
timer in the "seconds" range and do not care about the exact time of
the first call of the timer, use the g_timeout_add_seconds() function;
this function allows for more optimizations and more efficient system
power usage.

Pros: better battery life
Drawback: lower update interval

Patch based on http://trac.transmissionbt.com/changeset/7463

More on powersaving and timers:
http://mjg59.livejournal.com/74651.html?thread=452251
Comment 1 Dimitar Zhekov 2009-05-23 15:25:54 CEST
Additionally, on my machine, tooltip updates faster than 1 second either hide or "blink" the tip. This patch is a shorter form of "g_timeout_add_seconds on glib version >=2.14" and uses the new tooltip api existing since gtk+ 2.12. There is no check for gtk >= 2.12 though, I don't believe someone will compile the newer wavelan with a gtk version released almost 2 years ago.
Comment 2 Dimitar Zhekov 2009-05-23 15:27:09 CEST
Created attachment 2367 
g_timeout_add_seconds on glib >=2.14 + tooltip api >= 2.12
Comment 3 Florian Rivoal editbugs 2010-11-19 15:22:29 CET
Fixed by applying the patch from Morten.

As for tooltips, I just fixed them in bug #5866. I still used the g_strdup_printf -> g_strdup change proposed in the patch by Dimitar Zhekov.

Bug #5181

Reported by:
Morten
Reported on: 2009-04-02
Last modified on: 2010-11-19

People

Assignee:
Florian Rivoal
CC List:
2 users

Version

Version:
0.5.5 or older

Attachments

Additional information