Permalink
Browse files

In xfsettingsd, properly handle the case when upowerd isnt here (which

happens if you didn't add messagebus to pkg_scripts)

https://bugzilla.xfce.org/show_bug.cgi?id=11773
originally reported by danj@, edd@ and probably others..

tested by edd@ and myself, ok danj@ edd@
  • Loading branch information...
landryb committed Sep 1, 2016
1 parent e537c86 commit 6592ba86ac9bbd1afbb7e9328d23dc264cd48040
@@ -1,10 +1,10 @@
# $OpenBSD: Makefile,v 1.28 2015/04/04 09:21:09 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.29 2016/09/01 10:14:38 landry Exp $
COMMENT= Xfce4 settings helpers
XFCE_PROJECT= xfce4-settings
XFCE_VERSION= 4.12.0
REVISION= 0
REVISION= 1
# GPLv2
PERMIT_PACKAGE_CDROM= Yes
@@ -0,0 +1,22 @@
$OpenBSD: patch-xfsettingsd_displays-upower_c,v 1.1 2016/09/01 10:14:38 landry Exp $
Don't crash when upowerd isnt here
https://bugzilla.xfce.org/show_bug.cgi?id=11773
--- xfsettingsd/displays-upower.c.orig Wed Aug 31 12:27:41 2016
+++ xfsettingsd/displays-upower.c Wed Aug 31 12:28:06 2016
@@ -100,6 +100,13 @@ static void
xfce_displays_upower_init (XfceDisplaysUPower *upower)
{
upower->client = up_client_new ();
+ if (!UP_IS_CLIENT (upower->client))
+ {
+ upower->handler = 0;
+ upower->lid_is_closed = 0;
+ return;
+ }
+
upower->lid_is_closed = up_client_get_lid_is_closed (upower->client);
#if UP_CHECK_VERSION(0, 99, 0)
upower->handler = g_signal_connect (G_OBJECT (upower->client),

0 comments on commit 6592ba8

Please sign in to comment.