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. Fix: Force UPower not to care about the value of the sysctl, making it check only for its existence. Patch attached with submission follows: 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.
Responsible Changed From-To: freebsd-ports-bugs->gnome Over to maintainer (via the GNATS Auto Assign Tool)
Responsible Changed From-To: gnome->avilla Assigning to myself after maintainer timeout.
Author: avilla Date: Sat Feb 9 17:53:53 2013 New Revision: 311989 URL: http://svnweb.freebsd.org/changeset/ports/311989 Log: - Correctly detect laptop lid. - Bump PORTREVISION. Among other things, this commit lets KDE Workspaces react on lid closing (e.g., sleep/lock on lid closing). PR: 175531 Submitted by: avilla (myself) Approved by: gnome (maintainer timeout) Added: head/sysutils/upower/files/ head/sysutils/upower/files/patch-src__freebsd__up-backend.c (contents, props changed) Modified: head/sysutils/upower/Makefile (contents, props changed) Modified: head/sysutils/upower/Makefile ============================================================================== --- head/sysutils/upower/Makefile Sat Feb 9 17:17:54 2013 (r311988) +++ head/sysutils/upower/Makefile Sat Feb 9 17:53:53 2013 (r311989) @@ -1,13 +1,10 @@ -# New ports collection makefile for: DeviceKit-power -# Date Created: 30 December 2009 -# Whom: Joe Marcus Clarke <marcus@FreeBSD.org> -# +# Created by: Joe Marcus Clarke <marcus@FreeBSD.org> # $FreeBSD$ # $MCom: ports/sysutils/upower/Makefile,v 1.19 2010/10/05 08:30:15 kwm Exp $ -# PORTNAME= upower PORTVERSION= 0.9.7 +PORTREVISION= 1 CATEGORIES= sysutils MASTER_SITES= http://upower.freedesktop.org/releases/ Added: head/sysutils/upower/files/patch-src__freebsd__up-backend.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/upower/files/patch-src__freebsd__up-backend.c Sat Feb 9 17:53:53 2013 (r311989) @@ -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); \ No newline at end of file _______________________________________________ svn-ports-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-ports-all To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
State Changed From-To: open->closed Fix committed.
I'm not sure why this bug is still present in freebsd 11. upower 0.99.4 still checks for NONE in hw.acpi.lid_switch_state, which results in undetected lid switch. The proposed patch works, but somehow it did not make its way to port. I would re-open.
The patch has been applied to upower, and it is included in the 0.99.5 release. See : https://bugs.freedesktop.org/show_bug.cgi?id=101828
<https://www.freshports.org/sysutils/upower> - 0.99.5 not in the history - 0.99.7 committed 2018-09-30 👍