Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Jan 2013 13:48:30 GMT
From:      Alberto Villa <avilla@FreeBSD.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/175531: [patch] sysutils/upower: correctly detect lid
Message-ID:  <201301231348.r0NDmUb7067201@red.freebsd.org>
Resent-Message-ID: <201301231350.r0NDo0jm043097@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         175531
>Category:       ports
>Synopsis:       [patch] sysutils/upower: correctly detect lid
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 23 13:50:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Alberto Villa
>Release:        FreeBSD 10.0-CURRENT amd64
>Organization:
>Environment:
FreeBSD indiana.smith 10.0-CURRENT FreeBSD 10.0-CURRENT #1: Mon Oct 29 14:02:27 CET 2012     root@indiana.smith:/usr/obj/usr/src/sys/HPDV6  amd64
>Description:
UPower sets property LidIsPresent to true only if hw.acpi.lid_switch_state is different from "NONE", being "NONE" the default value for FreeBSD. Thus, the property is always false on default configurations.
>How-To-Repeat:
If hw.acpi.lid_switch_state is "NONE", `upower -d | grep lid-is-present` will show that the property is disabled. In the KDE Workspaces, this blocks any reaction on lid closing.
>Fix:
Force UPower not to care about the value of the sysctl, making it check only for its existence.

Patch attached with submission follows:

Index: Makefile
===================================================================
--- Makefile	(revision 310864)
+++ Makefile	(working copy)
@@ -8,6 +8,7 @@
 
 PORTNAME=	upower
 PORTVERSION=	0.9.7
+PORTREVISION=	1
 CATEGORIES=	sysutils
 MASTER_SITES=	http://upower.freedesktop.org/releases/
 
Index: files/patch-src__freebsd__up-backend.c
===================================================================
--- files/patch-src__freebsd__up-backend.c	(revision 0)
+++ files/patch-src__freebsd__up-backend.c	(working copy)
@@ -0,0 +1,11 @@
+--- ./src/freebsd/up-backend.c.orig	2010-11-01 12:28:43.000000000 +0100
++++ ./src/freebsd/up-backend.c	2013-01-23 02:42:21.293236052 +0100
+@@ -227,7 +227,7 @@
+ 	gchar *lid_state;
+ 
+ 	lid_state = up_get_string_sysctl (NULL, "hw.acpi.lid_switch_state");
+-	if (lid_state && strcmp (lid_state, "NONE")) {
++	if (lid_state) {
+ 		up_daemon_set_lid_is_present (backend->priv->daemon, TRUE);
+ 	}
+ 	g_free (lid_state);


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301231348.r0NDmUb7067201>