! 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 !
xfce power manager does not work with upower >= 0.99.0
Status:
RESOLVED: FIXED
Product:
Xfce4-power-manager
Component:
General

Comments

Description Stefan Seyfried 2014-04-13 11:19:49 CEST
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 :-)
Comment 1 Stefan Seyfried 2014-04-13 12:40:26 CEST
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(-)
Comment 2 Stefan Seyfried 2014-04-13 18:21:11 CEST
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"
Comment 3 Guido Berhoerster 2014-04-13 18:32:20 CEST
@eric: If you have time, could you take a look at this as well? Thanks.

Bug #10811

Reported by:
Stefan Seyfried
Reported on: 2014-04-13
Last modified on: 2014-04-22

People

Assignee:
Ali Abdallah
CC List:
6 users

Version

Attachments

Additional information