Your message dated Tue, 26 May 2015 10:13:23 +0000
with message-id <[email protected]>
and subject line Bug#426439: fixed in pbbuttonsd 0.7.9-7
has caused the Debian Bug report #426439,
regarding pbbuttonsd: Coexist with Gnome's power and volume daemons
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
426439: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=426439
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: pbbuttonsd
Version: 0.7.9-2
Tags: patch upstream

When using pbbuttonsd and Gnome, the two are fighting each other for
power management (gnome-power-manager) and volume control
(gnome-settings-daemon). This has the effect that the brightnes keys
react strangely and the mute key does not work because both pbbuttonsd
and g-settings-daemon trigger the muting once, thus nulling the
effect.

The attached patch makes pbbuttonsd ignore the events if it sees the
running Gnome daemons. I found that this dynamic approach works best,
since when disabling it completely by default this would cripple
pbbuttonsd too much for desktop environments which do not have
power/volume management.

Thanks for considering,

Martin
-- 
Martin Pitt              http://www.piware.de
Ubuntu Developer   http://www.ubuntulinux.org
Debian Developer        http://www.debian.org
--- pbbuttonsd-0.7.9.orig/src/module_alsamixer.c
+++ pbbuttonsd-0.7.9/src/module_alsamixer.c
@@ -22,6 +22,7 @@
 
 #include <math.h>
 #include <pbb.h>
+#include <sys/wait.h>
 
 #include "gettext_macros.h"
 #include "input_manager.h"
@@ -518,6 +519,24 @@
 			step = 0;
 		} else return;
 
+		/* check whether gnome-settings-daemon is running */
+		pid_t killall_pid = fork();
+		if (killall_pid == 0) {
+			execl ("/usr/bin/killall", "killall", "-q", "-s", "0", "gnome-settings-daemon", NULL);
+			perror("could not execute killall");
+			exit (1);
+		} else if (killall_pid > 0) {
+			int status;
+			if (wait (&status) > 0) {
+				if (WIFEXITED(status) && WEXITSTATUS(status) == 0) {
+					print_msg (PBB_WARN, _("Ignoring volume control key since gnome-settings-daemon is running\n"));
+					return;
+				}
+			} else
+			    perror("wait on killall");
+		} else
+		    perror ("forking killall");
+
 		if ((step == 0) || (mod & MOD_SHIFT))
 			alsamixer_set_and_send(ALSAMIXER_REL, step); /* mute and fine tuning */
 		else
only in patch2:
unchanged:
--- pbbuttonsd-0.7.9.orig/src/module_powersave.c
+++ pbbuttonsd-0.7.9/src/module_powersave.c
@@ -24,6 +24,7 @@
 #include <utmp.h>
 #include <sys/time.h>
 #include <sys/ioctl.h>
+#include <sys/wait.h>
 #include <sys/kd.h>
 #include "pbbinput.h"
 
@@ -370,6 +371,23 @@
 	struct moddata_power *base = &modbase_power;
 	int err, val;
 
+	/* check whether gnome-power-manager is running */
+	int gpm_running = 0;
+	pid_t killall_pid = fork();
+	if (killall_pid == 0) {
+		execl ("/usr/bin/killall", "killall", "-q", "-s", "0", "gnome-power-manager", NULL);
+		perror("could not execute killall");
+		exit (1);
+	} else if (killall_pid > 0) {
+		int status;
+		if (wait (&status) > 0) {
+			if (WIFEXITED(status) && WEXITSTATUS(status) == 0)
+			       gpm_running = 1;
+		} else
+		    perror("wait on killall");
+	} else
+	    perror ("forking killall");
+
 	while (taglist->tag != TAG_END) {
 		switch (taglist->tag) {
 		case TAG_REINIT:
@@ -580,7 +598,7 @@
 			else		taglist->data = base->flags.heartbeat_enable;
 			break;
 		case TAG_POWERCHANGED:  /* private tag */
-			if (cfgure) {
+			if (cfgure && !gpm_running) {
 				if (taglist->data)
 					base->activeProfile = &base->onAC;
 				else
@@ -628,7 +646,7 @@
 			/* PMCS-script will be called in power_suspend() so that it's nothing left to do here */
 			break;
 		case TAG_WAKEUPFROMSLEEP:  /* private tag */
-			if (cfgure) {
+			if (cfgure && !gpm_running) {
 				power_awake ();
 				val = base->powersource;
 				power_sync ();  /* syncronise redundant data from module_pmac */
@@ -641,7 +659,7 @@
 			}
 			break;
 		case TAG_COVERSTATUS:  /* private tag */
-			if (cfgure) {
+			if (cfgure && !gpm_running) {
 				base->flags.coveropen = taglist->data & 1;
 				val = base->activeProfile->coveraction;
 				if (val == ACTION_BLANK || ((val == ACTION_TORAM) && !base->flags.sleep_supported))

Attachment: signature.asc
Description: Digital signature


--- End Message ---
--- Begin Message ---
Source: pbbuttonsd
Source-Version: 0.7.9-7

We believe that the bug you reported is fixed in the latest version of
pbbuttonsd, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Mathieu Malaterre <[email protected]> (supplier of updated pbbuttonsd package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Tue, 26 May 2015 10:14:52 +0200
Source: pbbuttonsd
Binary: pbbuttonsd pbbuttonsd-dev
Architecture: source powerpc
Version: 0.7.9-7
Distribution: unstable
Urgency: medium
Maintainer: Mathieu Malaterre <[email protected]>
Changed-By: Mathieu Malaterre <[email protected]>
Description:
 pbbuttonsd - PBButtons daemon to handle special hotkeys of Apple computers
 pbbuttonsd-dev - Development files for PBButtons
Closes: 426437 426438 426439 426441 428494 429267
Changes:
 pbbuttonsd (0.7.9-7) unstable; urgency=medium
 .
   * Sync with Ubuntu packages. Closes: #426439, #426441, #428494, #426438
   * Drop Recommends on laptop-mode-tools, which we don't want installed by
     default.
     - d/rules: Remove laptop-mode.sh
   * Remove 0 and 6 from Default-Stop line in init script for good measure.
   * Exit init script when there is no PMU. Closes: #426437
   * Add debian/pbbuttonsd.udev: Send SIGHUP to pbbuttonsd when a new input
     device appears. Install it in debian/rules.
   * Update d/p/English-language-fixes.patch from lintian reports.
   * usbhid module parameter moved. Closes: #429267
     - d/p/bug429267.patch
Checksums-Sha1:
 d996597c0f8eb1d4ff7279a3a8b3f74818d32ee8 2060 pbbuttonsd_0.7.9-7.dsc
 7974dfef17e5870d81f16112ff1cb031827e1092 15084 pbbuttonsd_0.7.9-7.debian.tar.xz
 073dd2a1f1a5219353c552c1ddda9dfe7adf8b0a 139260 pbbuttonsd_0.7.9-7_powerpc.deb
 0e7b17a936347a6dc61ba4962db5fcdbe702d4e1 40746 
pbbuttonsd-dev_0.7.9-7_powerpc.deb
Checksums-Sha256:
 50a11a7b4bb5cd88a1f3b49822cc93fb89ebd0483914adfdfbab3c50e1bbd0e3 2060 
pbbuttonsd_0.7.9-7.dsc
 933b1f1f5ef546442ff755e50f915aebf1c3c12b21f053337a75d012734e77ee 15084 
pbbuttonsd_0.7.9-7.debian.tar.xz
 2bb2ce5bdc54e9ed9c5a152a435011101a093541e6bfccb049a10662262e2c32 139260 
pbbuttonsd_0.7.9-7_powerpc.deb
 2a561d05514e8daea2c091d66d10bbe6793ec59214f389048e56f4c729bcb74a 40746 
pbbuttonsd-dev_0.7.9-7_powerpc.deb
Files:
 d725dbe489b6eb48a3b82864e827affa 2060 admin optional pbbuttonsd_0.7.9-7.dsc
 d7a6cb8ff5c438335217427a649801cc 15084 admin optional 
pbbuttonsd_0.7.9-7.debian.tar.xz
 9d018539f2f0fc2730de87dc19bcb69d 139260 admin optional 
pbbuttonsd_0.7.9-7_powerpc.deb
 1c2af6592db7f7323b9d9cf896a12daa 40746 devel optional 
pbbuttonsd-dev_0.7.9-7_powerpc.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJVZDCeAAoJEAFx4YKK4JNF4fcP/iPDpE98M3+vIeM7x+K6IJ/5
XICQqE6Aq619537oMqVc3COf+RbW94jrrIl65S7jL2D/8UhNOSpIhGSsUoA6gU0G
4RunPD1yPUn+NBwCBm9rfue9VORdvdOTosDQjJx4AB0U1NY4qBlv28PiTv+lMApl
S8ut7mjPbO1jkq5bVifFeaqK7TE+rBxYvbrUwnMrw+MsjJxmWr5mM4PWz5Oq7avt
UkhqAPettoa5iveIXshcvKcd+vnUhEClDP92sW3SviafUf1bUhHsGX0//bVTd4ri
KBPGgQrygArOySfONB4WEyhTIEx5b6QQ99muH4ZG1d89l66ny11RJUd4vWiyO1P8
Wsf/8Wh/Gm0f3moAzbe035DoyjNdxueGU7WWRmUUUkH/Z+iWX4gfm2TiIGGMZiYn
vKUpJGclxveu+S9l/12sCb9U0EQe/yd83+03lawTys7sCzkYIv7IVsku/uHVXi9D
lur6iiM28GfZML3cSZtgs7VigWj2AfY46lGV+yfAoVzGKMYbE2wjfAFq9ze1GTf7
5FwklNiNSWJGvan0IcOIMARTV8OQGIrDWfUpOHpH7rb8vu0obW8zrNHRMq8sQJxh
SiiRwOxfDEeAP6qMnSmVIjpaa40QEe/BUU8Uz8ZYL4+rwZTBfpGnq8QdjsMzuZJs
MQeXVf/9kKaEMj9SfNl+
=PKzX
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to