rpms/hal/OLPC-2 hal-grab-input.patch,NONE,1.1 hal.spec,1.139,1.140

Daniel Williams (dcbw) fedora-extras-commits at redhat.com
Mon Jul 16 02:01:06 UTC 2007


Author: dcbw

Update of /cvs/extras/rpms/hal/OLPC-2
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv28818

Modified Files:
	hal.spec 
Added Files:
	hal-grab-input.patch 
Log Message:
* Sun Jul 15 2007 Dan Williams <dcbw at redhat.com> - 0.5.10-0.3.20070710git
- Grab input devices that OHM will use away from X so X doesn't have them
  exclusively (patch from Chris Ball)



hal-grab-input.patch:

--- NEW FILE hal-grab-input.patch ---
--- hal-0.5.10/hald/linux/addons/addon-input.c.old
+++ hal-0.5.10/hald/linux/addons/addon-input.c
@@ -39,6 +39,7 @@
 #include <linux/input.h>
 #include <glib/gmain.h>
 #include <glib/gprintf.h>
+#include <glib/gstring.h>
 #include <dbus/dbus-glib-lowlevel.h>
 
 #include "libhal/libhal.h"
@@ -377,6 +378,15 @@ add_device (LibHalContext *ctx,
 	channel = g_io_channel_unix_new (eventfp);
 	g_io_channel_set_encoding (channel, NULL, NULL);
 
+	if ((g_ascii_strncasecmp("/dev/input/event0", device_file, 17) == 0) ||
+	    (g_ascii_strncasecmp("/dev/input/event1", device_file, 17) == 0) ||
+	    (g_ascii_strncasecmp("/dev/input/event2", device_file, 17) == 0))
+	{
+		/* 0: PM, 1: lid switch, 2: ebook sensor */
+		HAL_DEBUG (("grabbing %s\n", device_file));
+		if (ioctl(g_io_channel_unix_get_fd(channel), EVIOCGRAB, (void *)1) < 0)
+        		HAL_DEBUG (("ioctl EVIOCGRAB failed"));
+        }
 	g_hash_table_insert (inputs, g_strdup(udi), channel);
 	g_io_add_watch_full (channel,
 			     G_PRIORITY_DEFAULT, G_IO_IN | G_IO_ERR | G_IO_HUP,


Index: hal.spec
===================================================================
RCS file: /cvs/extras/rpms/hal/OLPC-2/hal.spec,v
retrieving revision 1.139
retrieving revision 1.140
diff -u -r1.139 -r1.140
--- hal.spec	10 Jul 2007 10:25:45 -0000	1.139
+++ hal.spec	16 Jul 2007 02:00:34 -0000	1.140
@@ -26,11 +26,14 @@
 Summary: Hardware Abstraction Layer
 Name: hal
 Version: 0.5.10
-Release: 0.2.%{alphatag}%{?dist}
+Release: 0.3.%{alphatag}%{?dist}
 URL: http://www.freedesktop.org/Software/hal
 Source0: http://people.freedesktop.org/~david/dist/%{name}-%{version}-0.%{alphatag}.tar.gz
 Source1: 99-redhat-storage-policy-fixed-drives.fdi
 
+# OLPC specific
+Patch0: hal-grab-input.patch
+
 License: AFL/GPL
 Group: System Environment/Libraries
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) 
@@ -118,6 +121,9 @@
 %prep
 %setup -q
 
+# OLPC specifc hack
+%patch0 -p1 -b .grab-input-from-X
+
 %build
 %configure --enable-docbook-docs --docdir=%{_datadir}/doc/%{name}-%{version} --with-os-type=redhat --enable-console-kit --disable-acl-management --enable-umount-helper --enable-acpi-ibm --enable-acpi-toshiba --with-eject=/usr/sbin/eject
 
@@ -236,6 +242,10 @@
 %{_datadir}/gtk-doc/html/libhal-storage/*
 
 %changelog
+* Sun Jul 15 2007 Dan Williams <dcbw at redhat.com> - 0.5.10-0.3.20070710git
+- Grab input devices that OHM will use away from X so X doesn't have them
+  exclusively (patch from Chris Ball)
+
 * Tue Jul 10 2007 Marco Pesenti Gritti <mpg at redhat.com> - 0.5.10-0.2.20070710git
 - New snapshot which fixes issues with the battery properties
 




More information about the fedora-extras-commits mailing list