User-Agent: Mozilla/5.0 (X11; U; Linux i686; pl; rv:1.8.1.3) Gecko/20070508 Firefox/2.0.0.3 Build Identifier: [ I posted this to goodies-dev earlier, but got no response, so I'm posting it here as well ] 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 was 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 :) Reproducible: Always
(*) 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
Created attachment 1345 Patch for xfce4-battery-plugin using gthread
Created attachment 1346 Patch for xfce4-battery-plugin using battery status provided by sysfs
The sysfs patch won't work for 2.6.24 kernels (some file names have changed). I'm attaching a fixed patch.
Created attachment 1411 sysfs patch for battery plugin, reloaded
AC is sometimes called ACAD in /sys/class/power_supply. I'll come with a refreshed patch wich fixes this. Could this patch (or a variant) be integrated, now that 2.6.24 is out? Cheers,
(In reply to comment #6) > AC is sometimes called ACAD in /sys/class/power_supply. I'll come with a > refreshed patch wich fixes this. > > Could this patch (or a variant) be integrated, now that 2.6.24 is out? Mhmh, in the end, we may have a situation. The sysfs patch doesn't work really great. Some users say the indicator is stuck at 28%. Some people don't have any /sys/class/power_supply/AC but other weird and non standard names. The plugin shouldn't look at fixed folder name but rather detect correctly AC/BAT folder names. This is becoming an issue, because ACPI_PROCFS_POWER is now deprecated and may be removed in 2.6.26. The hal-based branch is not yet stable (at least officially), and, well, depends on hal. Bartosz: could refresh your patch so it works correctly on all boxes? I tried to look at it, but this is a quite intrusive change so I'm really not sure. Nick: maybe the solution is to deprecate the 0.5.0 battery plugin early, and switch to hal (even if this add hal dependency on laptops). What do you think?
I don't think the hal dependency is a show stopper. That said, I'm not really putting any time in acpi version, since I think it's a dead end. So for patch writer, I can only suggest to work on the hal-based version (please).
(In reply to comment #8) > I don't think the hal dependency is a show stopper. That said, I'm not really > putting any time in acpi version, since I think it's a dead end. So for patch > writer, I can only suggest to work on the hal-based version (please). Do you think releasing the hal-based version as stable is possible anytime soon? I'm running it currently (with the integrated patche for progress bar and the remaining_time correctly picked up) and it seems to work fine.
As far as I can tell, the patch in Bug #3793 makes this one obsolete. Closing this one since I applied that one. Please reopen (with an explanation) if I got this wrong. *** This bug has been marked as a duplicate of bug 3793 ***