! 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 !
Fix compilation and other issues on FreeBSD (patch attached)
Status:
RESOLVED: FIXED
Product:
Xfce4-power-manager
Component:
General

Comments

Description cmangin 2011-05-30 00:21:31 CEST
Created attachment 3701 
Some fixes for version 1.0.10 under FreeBSD

I've managed to make xfce4-power-manager v1.0.10 work on my laptop under FreeBSD 8.2-RELEASE. (The one in the ports is old and needs HAL which I wanted to get rid of)

Beside basic compilation, these are the issues I came across:

- When you select the option of always showing the icon in the notification area, I found that the AC adapter icon did not show up when the battery was not present. When the battery was inserted into the laptop, the battery icon showed up. When removed again, a 'not found' icon appeared and clicking on it made the program crash.

After running with the --debug switch, I found that under FreeBSD (unlike Linux), the battery is always reported as 'present'. When the battery is not actually in the slot, the state of the battery is reported as 'unknown'. 
The programs doesn't show the AC adapter icon because it thinks the battery is always there, and worse it tries to display the icon of the battery when in the 'unknown' state (not there).

I've managed to 'fix' the issue by testing the state of the battery and not simply it's presence.

- Also after the initial fix I found that the AC adapter icon did not refresh when the battery was inserted or removed. (A second icon appeared instead)  

I've added a callback to 'xfpm_power_refresh_adaptor_visible' which seems to fix the issues. However I'm uncertain if that is a correct approach.

--

The diff to the files: 

configure
src/xfpm-polkit.c

Are needed to configure and compile under FreeBSD 8-2-RELEASE.

The diff in the following files fixes the other issues I had:

src/xfpm-power.c
src/xfpm-battery.h
src/xfpm-battery.c

The patch was also tested under Linux to make sure I wasn't breaking anything.
Comment 1 cmangin 2011-05-30 01:34:58 CEST
Created attachment 3702 
Some fixes to version 1.0.10 for FreeBSD
Comment 2 Olivier Duchateau 2012-04-20 09:44:20 CEST
This patch is still necessary for xfce4-power-manager v1.1.0 under FreeBSD ?
Comment 3 cmangin 2012-04-20 22:53:46 CEST
I have no idea. The new version isn't even present on the project page yet.
It's rather easy to test if you have a laptop. Just swap the battery in and out and see if the panel icon misbehave.
Comment 4 Simon Steinbeiss editbugs 2014-06-30 13:56:13 CEST
We successfully built git master on FreeBSD so this bug should be resolved:
http://li604-44.members.linode.com:8080/job/xfce4-power-manager/

Bug #7675

Reported by:
cmangin
Reported on: 2011-05-30
Last modified on: 2014-06-30

People

Assignee:
Ali Abdallah
CC List:
3 users

Version

Version:
1.0.10

Attachments

Additional information