[Goodies-dev] xfce4-battery-plugin: problems with responsiveness & patches

Bartosz Janiak firejump at o2.pl
Mon Sep 3 17:46:58 CEST 2007


Hello everyone,

I'm not sure if I should post this here or to bugzilla, so please tell
me if the latter is the case.

I've got some problems with interface responsiveness in
xfce4-battery-plugin, that is - the tooltip showed up much too late, and
the configuration dialog is hardly usable - I had to wait a few seconds
after each click for the interface to react. This is due to the fact
that reading battery & AC /proc entries blocks the whole application
for ~2 seconds.

I've found two ways to solve this problem (and I think that both should
be available in xfce4-battery-plugin):

1. Reading those files in a separate thread.
2. Checking battery & AC status from /sys entries instead (which can be
read without blocking the interface). This is possible on linux
2.6.23-rc3-mm1 with some patches(*) from linux-acpi mailing list, and
should be available in stable kernel soon. I use it currently and
haven't found any bugs yet, so I thought I'd share this solution as
well.

I include both patches (they're separate now, but merging them
shouldn't be a big problem). I'm new to this project - and
open-source development in general - so they aren't probably done the
Right Way. Criticism welcome :)

Also, in the unlikely event of those patches being accepted, I'd like to
work some more on xfce4-battery-plugin - IMO the code (especially
libacpi.c) needs a general cleanup.

Regards,
Bartosz

(*) http://marc.info/?l=linux-acpi&m=118618044007413&w=2
http://marc.info/?l=linux-acpi&m=118683930503710&w=2
http://marc.info/?l=linux-acpi&m=118727459117847&w=2
http://marc.info/?l=linux-acpi&m=118727438029859&q=raw

I've put them all together here:
http://students.mimuw.edu.pl/~bj248380/opos/linux-2.6.23-rc3-mm1-battery-ac-sysfs.patch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xfce4-battery-plugin-gthread.patch
Type: text/x-patch
Size: 5188 bytes
Desc: not available
URL: <http://mail.xfce.org/pipermail/goodies-dev/attachments/20070903/0a56d2bd/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xfce4-battery-plugin-sysfs.patch
Type: text/x-patch
Size: 6799 bytes
Desc: not available
URL: <http://mail.xfce.org/pipermail/goodies-dev/attachments/20070903/0a56d2bd/attachment-0001.bin>


More information about the Goodies-dev mailing list