Created attachment 5429 already outdated patch for upower-0.99.0 current UPower version 0.99.0 has dropped many deprecated APIs and some functionality (amongst others, suspend / hibernate, which needs to be done via systemd/logind now). This causes xfpm to more or less silently fail in many areas: * no more notification about AC adapter offline / online * no more notification about battery removal / insertion In order to help fixing this issue, I have ported (most?) parts of xfpm to use liubupower-glib instead of issuing dbus-calls directls. IMO the code also gets simpler with that. I verified that it still works with upower-0.9.21 (openSUSE 13.1). It now works with upower-0.99.0 (openSUSE Factory / 13.2), but suspend/hibernate functionality needs to be implemented via logind. There are patches for this, but that's a different issue IMO. For now I added compiler warnings showing, that this is not yet implemented with upower >= 0.99.0. This is against master as of yesterday (bd35b9833f7c834c3bf12d763ac4798db244a77b) I see right now that logind suspend has been committed and will rebase immediately :-)
Created attachment 5430 port of xfpm to libupower-glib, including support for upower >= 0.99.0 This works for me with upower-0.9.23 (openSUSE 13.1) and upower-0.99.0 And hey -- it removes more lines than it adds! :-) From fb94c660e05e08177b1eca7cbbd88b74e770ea2d Mon Sep 17 00:00:00 2001 From: Stefan Seyfried <seife+dev@b1-systems.com> Date: Sun, 13 Apr 2014 12:05:19 +0200 Subject: [PATCH] port xfpm to libupower-glib / add support for upower-0.99.0 API * port most of the upower interfaces to upower-glib * conditionalize stuff that has been deprecated in upower >= 0.99.0 * suspend / hibernate is handled by systemd/logind * if upower is >= 0.99.0 and logind is not running, log errors (as functionality will be missing) --- configure.ac.in | 2 + src/Makefile.am | 4 + src/xfpm-battery.c | 136 ++++++++----------------- src/xfpm-battery.h | 3 +- src/xfpm-power-common.c | 79 --------------- src/xfpm-power-common.h | 13 +-- src/xfpm-power-info.c | 220 +++++++++++++++------------------------- src/xfpm-power.c | 265 +++++++++++++++++------------------------------- 8 files changed, 225 insertions(+), 497 deletions(-)
I have pushed additional fixes / cleanups to https://github.com/b1-systems/for-upstream-xfce4-power-manager.git the branch for this bug is "upower-glib-0_99"
@eric: If you have time, could you take a look at this as well? Thanks.
Happily added. Thanks for the patches, pushed to master in: http://git.xfce.org/xfce/xfce4-power-manager/commit/?id=ae97be6f3500eea509d61c914e22c5355e7d57de and http://git.xfce.org/xfce/xfce4-power-manager/commit/?id=7f4fb9c021fb80d28d2ef7dcdbd3839a39d16f99