xserver: Branch 'master' - 15 commits

Daniel Stone daniels at kemper.freedesktop.org
Tue Jul 31 15:53:27 PDT 2007


 .gitignore                             |    1 
 config/Makefile.am                     |   17 -
 config/config-backends.h               |   59 +++
 config/config.c                        |  541 ++-------------------------------
 config/dbus-api                        |   19 -
 config/dbus-core.c                     |  239 ++++++++++++++
 config/dbus.c                          |  441 ++++++++++++++++++++++++++
 config/hal.c                           |  371 ++++++++++++++++++++++
 configure.ac                           |   94 +++--
 dix/cursor.c                           |   22 +
 dix/devices.c                          |    1 
 dix/getevents.c                        |   44 +-
 dix/main.c                             |   26 -
 hw/kdrive/src/kinput.c                 |    1 
 hw/xfree86/common/xf86Init.c           |    2 
 hw/xfree86/common/xf86Module.h         |    2 
 hw/xfree86/common/xf86Xinput.c         |    1 
 hw/xfree86/os-support/hurd/hurd_bell.c |   30 -
 hw/xfree86/os-support/linux/lnx_bell.c |   30 -
 include/dix-config.h.in                |    8 
 include/dix.h                          |    3 
 include/hotplug.h                      |   49 +-
 include/inputstr.h                     |    1 
 23 files changed, 1369 insertions(+), 633 deletions(-)

New commits:
diff-tree a93033b0bc14ed0bb95c680ded26b63cfe5fd1d3 (from 1150969b826e2bd6d8345fa245ed499f2e4cf101)
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Wed Aug 1 01:53:08 2007 +0300

    XFree86: Module: Bump input version
    
    config_info changes the size (and ordering) of DeviceIntRec, so bump the
    input major.

diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
index 4f9c0ca..20d8b44 100644
--- a/hw/xfree86/common/xf86Module.h
+++ b/hw/xfree86/common/xf86Module.h
@@ -84,7 +84,7 @@ typedef enum {
  */
 #define ABI_ANSIC_VERSION	SET_ABI_VERSION(0, 3)
 #define ABI_VIDEODRV_VERSION	SET_ABI_VERSION(2, 0)
-#define ABI_XINPUT_VERSION	SET_ABI_VERSION(1, 1)
+#define ABI_XINPUT_VERSION	SET_ABI_VERSION(2, 0)
 #define ABI_EXTENSION_VERSION	SET_ABI_VERSION(0, 3)
 #define ABI_FONT_VERSION	SET_ABI_VERSION(0, 5)
 
diff-tree 1150969b826e2bd6d8345fa245ed499f2e4cf101 (from 8658f5d923a69fb55b4cd9e1e84c2d271679f6e2)
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Wed Aug 1 01:52:20 2007 +0300

    Convert all my license statements to the standard form
    
    Convert all my license statements to the standard, accepted form:
    cf. <20070717142307.GD13478 at fooishbar.org>
        http://lists.freedesktop.org/archives/xorg/2007-July/026451.html
    
    keithp's license on configure.ac changed with his verbal permission.

diff --git a/config/config-backends.h b/config/config-backends.h
index dd87a86..ce0e5e4 100644
--- a/config/config-backends.h
+++ b/config/config-backends.h
@@ -1,24 +1,26 @@
 /*
  * Copyright © 2006-2007 Daniel Stone
  *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of the copyright holders and/or authors
- * not be used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.  The copyright holders
- * and/or authors make no representations about the suitability of this
- * software for any purpose.  It is provided "as is" without express or
- * implied warranty.
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
  *
- * THE COPYRIGHT HOLDERS AND/OR AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND/OR AUTHORS BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Daniel Stone <daniel at fooishbar.org>
  */
 
 #ifdef HAVE_DIX_CONFIG_H
diff --git a/config/config.c b/config/config.c
index 837dd00..1067d18 100644
--- a/config/config.c
+++ b/config/config.c
@@ -1,24 +1,26 @@
 /*
  * Copyright © 2006-2007 Daniel Stone
  *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of the copyright holders and/or authors
- * not be used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.  The copyright holders
- * and/or authors make no representations about the suitability of this
- * software for any purpose.  It is provided "as is" without express or
- * implied warranty.
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
  *
- * THE COPYRIGHT HOLDERS AND/OR AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND/OR AUTHORS BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Daniel Stone <daniel at fooishbar.org>
  */
 
 #ifdef HAVE_DIX_CONFIG_H
diff --git a/config/dbus-core.c b/config/dbus-core.c
index 5cc80e3..008e21a 100644
--- a/config/dbus-core.c
+++ b/config/dbus-core.c
@@ -1,24 +1,26 @@
 /*
  * Copyright © 2006-2007 Daniel Stone
  *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of the copyright holders and/or authors
- * not be used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.  The copyright holders
- * and/or authors make no representations about the suitability of this
- * software for any purpose.  It is provided "as is" without express or
- * implied warranty.
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
  *
- * THE COPYRIGHT HOLDERS AND/OR AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND/OR AUTHORS BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Daniel Stone <daniel at fooishbar.org>
  */
 
 #ifdef HAVE_DIX_CONFIG_H
diff --git a/config/dbus.c b/config/dbus.c
index 861aa8e..c6f4af0 100644
--- a/config/dbus.c
+++ b/config/dbus.c
@@ -1,24 +1,26 @@
 /*
  * Copyright © 2006-2007 Daniel Stone
  *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of the copyright holders and/or authors
- * not be used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.  The copyright holders
- * and/or authors make no representations about the suitability of this
- * software for any purpose.  It is provided "as is" without express or
- * implied warranty.
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
  *
- * THE COPYRIGHT HOLDERS AND/OR AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND/OR AUTHORS BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Daniel Stone <daniel at fooishbar.org>
  */
 
 #ifdef HAVE_DIX_CONFIG_H
diff --git a/config/hal.c b/config/hal.c
index 66e4936..f29ba92 100644
--- a/config/hal.c
+++ b/config/hal.c
@@ -1,24 +1,26 @@
 /*
- * Copyright © 2006-2007 Daniel Stone
+ * Copyright © 2007 Daniel Stone
  *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of the copyright holders and/or authors
- * not be used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.  The copyright holders
- * and/or authors make no representations about the suitability of this
- * software for any purpose.  It is provided "as is" without express or
- * implied warranty.
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
  *
- * THE COPYRIGHT HOLDERS AND/OR AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND/OR AUTHORS BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Daniel Stone <daniel at fooishbar.org>
  */
 
 #ifdef HAVE_DIX_CONFIG_H
diff --git a/configure.ac b/configure.ac
index 6752ca9..17da31e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,24 +1,27 @@
-dnl $Id$
+dnl Copyright © 2003-2007 Keith Packard, Daniel Stone
 dnl
-dnl Copyright © 2003-2005 Keith Packard, Daniel Stone
+dnl Permission is hereby granted, free of charge, to any person obtaining a
+dnl copy of this software and associated documentation files (the "Software"),
+dnl to deal in the Software without restriction, including without limitation
+dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
+dnl and/or sell copies of the Software, and to permit persons to whom the
+dnl Software is furnished to do so, subject to the following conditions:
 dnl
-dnl Permission to use, copy, modify, distribute, and sell this software and its
-dnl documentation for any purpose is hereby granted without fee, provided that
-dnl the above copyright notice appear in all copies and that both that
-dnl copyright notice and this permission notice appear in supporting
-dnl documentation, and that the names of Keith Packard and Daniel Stone not be
-dnl used in advertising or publicity pertaining to distribution of the software
-dnl without specific, written prior permission.  Keith Packard and Daniel Stone
-dnl make no representations about the suitability of this software for any
-dnl purpose.  It is provided "as is" without express or implied warranty.
+dnl The above copyright notice and this permission notice (including the next
+dnl paragraph) shall be included in all copies or substantial portions of the
+dnl Software.
 dnl
-dnl KEITH PACKARD AND DANIEL STONE DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
-dnl SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
-dnl IN NO EVENT SHALL KEITH PACKARD OR DANIEL STONE BE LIABLE FOR ANY SPECIAL,
-dnl INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-dnl LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-dnl OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-dnl PERFORMANCE OF THIS SOFTWARE.
+dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+dnl DEALINGS IN THE SOFTWARE.
+dnl
+dnl Authors: Keith Packard <keithp at keithp.com>
+dnl          Daniel Stone <daniel at fooishbar.org>
+dnl          an unwitting cast of miscellaneous others
 dnl
 dnl Process this file with autoconf to create configure.
 
diff --git a/dix/getevents.c b/dix/getevents.c
index 67990f2..bc3db79 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1,23 +1,25 @@
 /*
  * Copyright © 2006 Nokia Corporation
- * Copyright © 2006 Daniel Stone
+ * Copyright © 2006-2007 Daniel Stone
  *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and that
- * both that this copyright notice and this permission notice appear in
- * supporting electronic documentation.
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR AUTHORS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
  *
  * Author: Daniel Stone <daniel at fooishbar.org>
  */
diff --git a/hw/xfree86/os-support/hurd/hurd_bell.c b/hw/xfree86/os-support/hurd/hurd_bell.c
index 2726611..732a1ca 100644
--- a/hw/xfree86/os-support/hurd/hurd_bell.c
+++ b/hw/xfree86/os-support/hurd/hurd_bell.c
@@ -1,22 +1,24 @@
 /*
  * Copyright © 2006 Daniel Stone
  *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and that
- * both that this copyright notice and this permission notice appear in
- * supporting electronic documentation.
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
  *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
  *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR AUTHORS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
  *
  * Author: Daniel Stone <daniel at fooishbar.org>
  */
diff --git a/hw/xfree86/os-support/linux/lnx_bell.c b/hw/xfree86/os-support/linux/lnx_bell.c
index 6ef881b..93ad680 100644
--- a/hw/xfree86/os-support/linux/lnx_bell.c
+++ b/hw/xfree86/os-support/linux/lnx_bell.c
@@ -1,22 +1,24 @@
 /*
  * Copyright © 2006 Daniel Stone
  *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and that
- * both that this copyright notice and this permission notice appear in
- * supporting electronic documentation.
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
  *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
  *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR AUTHORS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
  *
  * Author: Daniel Stone <daniel at fooishbar.org>
  */
diff --git a/include/hotplug.h b/include/hotplug.h
index 2a72ab9..b4f1bb6 100644
--- a/include/hotplug.h
+++ b/include/hotplug.h
@@ -1,24 +1,26 @@
 /*
  * Copyright © 2006-2007 Daniel Stone
  *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of the copyright holders and/or authors
- * not be used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.  The copyright holders
- * and/or authors make no representations about the suitability of this
- * software for any purpose.  It is provided "as is" without express or
- * implied warranty.
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
  *
- * THE COPYRIGHT HOLDERS AND/OR AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND/OR AUTHORS BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Daniel Stone <daniel at fooishbar.org>
  */
 
 #ifndef HOTPLUG_H
diff-tree 8658f5d923a69fb55b4cd9e1e84c2d271679f6e2 (from aa75b3481724834da2f855d8dd2ff36074bd5706)
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Wed Aug 1 01:10:50 2007 +0300

    Hotplug: Add HAL support
    
    Add support for HAL-based hotplugging, in which we just get the list of
    input devices and properties from HAL.  Requires an FDI which is not yet
    in mainline HAL.

diff --git a/config/Makefile.am b/config/Makefile.am
index 5270344..e9811c6 100644
--- a/config/Makefile.am
+++ b/config/Makefile.am
@@ -16,4 +16,8 @@ noinst_LIBRARIES = libconfig.a
 libconfig_a_SOURCES += dbus.c
 endif
 
-EXTRA_DIST = xorg-server.conf
+if CONFIG_HAL
+libconfig_a_SOURCES += hal.c
+endif
+
+EXTRA_DIST = xorg-server.conf x11-input.fdi
diff --git a/config/config-backends.h b/config/config-backends.h
index 8a10a3e..dd87a86 100644
--- a/config/config-backends.h
+++ b/config/config-backends.h
@@ -50,3 +50,8 @@ void config_dbus_core_remove_hook(struct
 int config_dbus_init(void);
 void config_dbus_fini(void);
 #endif
+
+#ifdef CONFIG_HAL
+int config_hal_init(void);
+void config_hal_fini(void);
+#endif
diff --git a/config/config.c b/config/config.c
index a6d36c0..837dd00 100644
--- a/config/config.c
+++ b/config/config.c
@@ -31,10 +31,16 @@
 void
 config_init()
 {
-#if defined(CONFIG_DBUS_API)
+#if defined(CONFIG_DBUS_API) || defined(CONFIG_HAL)
     if (config_dbus_core_init()) {
+# ifdef CONFIG_DBUS_API
        if (!config_dbus_init())
 	    ErrorF("[config] failed to initialise D-Bus API\n");
+# endif
+# ifdef CONFIG_HAL
+        if (!config_hal_init())
+            ErrorF("[config] failed to initialise HAL\n");
+# endif
     }
     else {
 	ErrorF("[config] failed to initialise D-Bus core\n");
@@ -45,8 +51,13 @@ config_init()
 void
 config_fini()
 {
-#if defined(CONFIG_DBUS_API)
+#if defined(CONFIG_DBUS_API) || defined(CONFIG_HAL)
+# ifdef CONFIG_HAL
+    config_hal_fini();
+# endif
+# ifdef CONFIG_DBUS_API
     config_dbus_fini();
+# endif
     config_dbus_core_fini();
 #endif
 }
diff --git a/config/hal.c b/config/hal.c
new file mode 100644
index 0000000..66e4936
--- /dev/null
+++ b/config/hal.c
@@ -0,0 +1,369 @@
+/*
+ * Copyright © 2006-2007 Daniel Stone
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of the copyright holders and/or authors
+ * not be used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.  The copyright holders
+ * and/or authors make no representations about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS AND/OR AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND/OR AUTHORS BE LIABLE
+ * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <dbus/dbus.h>
+#include <hal/libhal.h>
+#include <string.h>
+#include <sys/select.h>
+
+#include "input.h"
+#include "inputstr.h"
+#include "hotplug.h"
+#include "config-backends.h"
+#include "os.h"
+
+#define TYPE_NONE 0
+#define TYPE_KEYS 1
+#define TYPE_POINTER 2
+
+struct config_hal_info {
+    DBusConnection *system_bus;
+    LibHalContext *hal_ctx;
+};
+
+static void
+remove_device(DeviceIntPtr dev)
+{
+    DebugF("[config/hal] removing device %s\n", dev->name);
+
+    /* Call PIE here so we don't try to dereference a device that's
+     * already been removed. */
+    OsBlockSignals();
+    ProcessInputEvents();
+    DeleteInputDeviceRequest(dev);
+    OsReleaseSignals();
+}
+
+static void
+device_removed(LibHalContext *ctx, const char *udi)
+{
+    DeviceIntPtr dev;
+    char *value;
+
+    value = xalloc(strlen(udi) + 5); /* "hal:" + NULL */
+    if (!value)
+        return;
+    sprintf(value, "hal:%s", udi);
+
+    for (dev = inputInfo.devices; dev; dev = dev->next) {
+        if (dev->config_info && strcmp(dev->config_info, value) == 0)
+            remove_device(dev);
+    }
+    for (dev = inputInfo.off_devices; dev; dev = dev->next) {
+        if (dev->config_info && strcmp(dev->config_info, value) == 0)
+            remove_device(dev);
+    }
+
+    xfree(value);
+}
+
+static void
+add_option(InputOption **options, const char *key, const char *value)
+{
+    if (!value || *value == '\0')
+        return;
+
+    for (; *options; options = &(*options)->next)
+        ;
+    *options = xcalloc(sizeof(**options), 1);
+    (*options)->key = xstrdup(key);
+    (*options)->value = xstrdup(value);
+    (*options)->next = NULL;
+}
+
+static char *
+get_prop_string(LibHalContext *hal_ctx, const char *udi, const char *name,
+                DBusError *error)
+{
+    char *prop, *ret;
+
+    prop = libhal_device_get_property_string(hal_ctx, udi, name, error);
+    DebugF(" [config/hal] getting %s on %s returned %s\n", name, udi, prop);
+    if (prop) {
+        ret = xstrdup(prop);
+        libhal_free_string(prop);
+    }
+    else {
+        return NULL;
+    }
+
+    return ret;
+}
+
+static char *
+get_prop_string_array(LibHalContext *hal_ctx, const char *udi, const char *prop,
+                      DBusError *error)
+{
+    char **props, *ret, *str;
+    int i, len = 0;
+
+    props = libhal_device_get_property_strlist(hal_ctx, udi, prop, error);
+    if (props) {
+        for (i = 0; props[i]; i++)
+            len += strlen(props[i]);
+
+        ret = xcalloc(sizeof(char), len + i); /* i - 1 commas, 1 NULL */
+        if (!ret) {
+            libhal_free_string_array(props);
+            return NULL;
+        }
+
+        str = ret;
+        for (i = 0; props[i]; i++) {
+            str = strcpy(str, props[i]);
+            *str++ = ',';
+        }
+        *str = '\0';
+
+        libhal_free_string_array(props);
+    }
+    else {
+        return NULL;
+    }
+
+    return ret;
+}
+
+static void
+device_added(LibHalContext *hal_ctx, const char *udi)
+{
+    char **props;
+    char *path = NULL, *driver = NULL, *name = NULL, *xkb_rules = NULL;
+    char *xkb_model = NULL, *xkb_layout = NULL, *xkb_variant = NULL;
+    char *xkb_options = NULL, *config_info = NULL;
+    InputOption *options = NULL;
+    DeviceIntPtr dev;
+    DBusError error;
+    int type = TYPE_NONE;
+    int i;
+
+    dbus_error_init(&error);
+
+    props = libhal_device_get_property_strlist(hal_ctx, udi,
+                                               "info.capabilities", &error);
+    if (!props) {
+        DebugF("[config/hal] couldn't get capabilities for %s: %s (%s)\n",
+               udi, error.name, error.message);
+        goto out_error;
+    }
+    for (i = 0; props[i]; i++) {
+        /* input.keys is the new, of which input.keyboard is a subset, but
+         * input.keyboard is the old 'we have keys', so we have to keep it
+         * around. */
+        if (strcmp(props[i], "input.keys") == 0 ||
+            strcmp(props[i], "input.keyboard") == 0)
+            type |= TYPE_KEYS;
+        if (strcmp(props[i], "input.mouse") == 0)
+            type |= TYPE_POINTER;
+    }
+    libhal_free_string_array(props);
+
+    if (type == TYPE_NONE)
+        goto out_error;
+
+    driver = get_prop_string(hal_ctx, udi, "input.x11_driver", &error);
+    path = get_prop_string(hal_ctx, udi, "input.device", &error);
+    if (!driver || !path) {
+        DebugF("[config/hal] no driver or path specified for %s\n", udi);
+        goto unwind;
+    }
+    name = get_prop_string(hal_ctx, udi, "info.product", &error);
+    if (!name)
+        name = xstrdup("(unnamed)");
+
+    if (type & TYPE_KEYS) {
+        xkb_rules = get_prop_string(hal_ctx, udi, "input.xkb_rules", &error);
+        xkb_model = get_prop_string(hal_ctx, udi, "input.xkb_model", &error);
+        xkb_layout = get_prop_string(hal_ctx, udi, "input.xkb_layout", &error);
+        xkb_variant = get_prop_string(hal_ctx, udi, "input.xkb_variant",
+                                      &error);
+        xkb_options = get_prop_string_array(hal_ctx, udi, "input.xkb_options",
+                                            &error);
+    }
+
+    options = xcalloc(sizeof(*options), 1);
+    options->key = xstrdup("_source");
+    options->value = xstrdup("server/hal");
+    if (!options->key || !options->value) {
+        ErrorF("[config] couldn't allocate first key/value pair\n");
+        goto unwind;
+    }
+
+    add_option(&options, "path", path);
+    add_option(&options, "driver", driver);
+    add_option(&options, "name", name);
+    config_info = xalloc(strlen(udi) + 5); /* "hal:" and NULL */
+    if (!config_info)
+        goto unwind;
+    sprintf(config_info, "hal:%s", udi);
+
+    if (xkb_model)
+        add_option(&options, "xkb_model", xkb_model);
+    if (xkb_layout)
+        add_option(&options, "xkb_layout", xkb_layout);
+    if (xkb_variant)
+        add_option(&options, "xkb_variant", xkb_variant);
+    if (xkb_options)
+        add_option(&options, "xkb_options", xkb_options);
+
+    if (NewInputDeviceRequest(options, &dev) != Success) {
+        DebugF("[config/hal] NewInputDeviceRequest failed\n");
+        goto unwind;
+    }
+
+    for (; dev; dev = dev->next)
+        dev->config_info = xstrdup(config_info);
+
+unwind:
+    if (path)
+        xfree(path);
+    if (driver)
+        xfree(driver);
+    if (name)
+        xfree(name);
+    if (xkb_rules)
+        xfree(xkb_rules);
+    if (xkb_model)
+        xfree(xkb_model);
+    if (xkb_layout)
+        xfree(xkb_layout);
+    if (xkb_options)
+        xfree(xkb_options);
+    if (config_info)
+        xfree(config_info);
+
+out_error:
+    dbus_error_free(&error);
+
+    return;
+}
+
+static void
+disconnect_hook(void *data)
+{
+    DBusError error;
+    struct config_hal_info *info = data;
+
+    if (info->hal_ctx) {
+        dbus_error_init(&error);
+        if (!libhal_ctx_shutdown(info->hal_ctx, &error))
+            DebugF("[config/hal] couldn't shut down context?\n");
+        libhal_ctx_free(info->hal_ctx);
+        dbus_error_free(&error);
+    }
+
+    info->hal_ctx = NULL;
+    info->system_bus = NULL;
+}
+
+static void
+connect_hook(DBusConnection *connection, void *data)
+{
+    DBusError error;
+    struct config_hal_info *info = data;
+    char **devices;
+    int num_devices, i;
+
+    info->system_bus = connection;
+
+    dbus_error_init(&error);
+
+    if (!info->hal_ctx)
+        info->hal_ctx = libhal_ctx_new();
+    if (!info->hal_ctx) {
+        ErrorF("[config/hal] couldn't create HAL context\n");
+        goto out_err;
+    }
+
+    if (!libhal_ctx_set_dbus_connection(info->hal_ctx, info->system_bus)) {
+        ErrorF("[config/hal] couldn't associate HAL context with bus\n");
+        goto out_ctx;
+    }
+    if (!libhal_ctx_init(info->hal_ctx, &error)) {
+        ErrorF("[config/hal] couldn't initialise context: %s (%s)\n",
+               error.name, error.message);
+        goto out_ctx;
+    }
+    if (!libhal_device_property_watch_all(info->hal_ctx, &error)) {
+        ErrorF("[config/hal] couldn't watch all properties: %s (%s)\n",
+               error.name, error.message);
+        goto out_ctx2;
+    }
+    libhal_ctx_set_device_added(info->hal_ctx, device_added);
+    libhal_ctx_set_device_removed(info->hal_ctx, device_removed);
+
+    devices = libhal_find_device_by_capability(info->hal_ctx, "input",
+                                               &num_devices, &error);
+    for (i = 0; i < num_devices; i++)
+        device_added(info->hal_ctx, devices[i]);
+    libhal_free_string_array(devices);
+
+    dbus_error_free(&error);
+
+    return;
+
+out_ctx2:
+    if (!libhal_ctx_shutdown(info->hal_ctx, &error))
+        DebugF("[config/hal] couldn't shut down context?\n");
+out_ctx:
+    libhal_ctx_free(info->hal_ctx);
+out_err:
+    dbus_error_free(&error);
+
+    info->hal_ctx = NULL;
+    info->system_bus = NULL;
+
+    return;
+}
+
+static struct config_hal_info hal_info;
+static struct config_dbus_core_hook hook = {
+    .connect = connect_hook,
+    .disconnect = disconnect_hook,
+    .data = &hal_info,
+};
+
+int
+config_hal_init(void)
+{
+    memset(&hal_info, 0, sizeof(hal_info));
+    hal_info.system_bus = NULL;
+    hal_info.hal_ctx = NULL;
+
+    if (!config_dbus_core_add_hook(&hook)) {
+        ErrorF("[config/hal] failed to add D-Bus hook\n");
+        return 0;
+    }
+
+    return 1;
+}
+
+void
+config_hal_fini(void)
+{
+    config_dbus_core_remove_hook(&hook);
+}
diff --git a/configure.ac b/configure.ac
index 96439c7..6752ca9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -520,6 +520,7 @@ AC_ARG_ENABLE(dbe,            AS_HELP_ST
 AC_ARG_ENABLE(xf86bigfont,    AS_HELP_STRING([--disable-xf86bigfont], [Build XF86 Big Font extension (default: enabled)]), [XF86BIGFONT=$enableval], [XF86BIGFONT=yes])
 AC_ARG_ENABLE(dpms,           AS_HELP_STRING([--disable-dpms], [Build DPMS extension (default: enabled)]), [DPMSExtension=$enableval], [DPMSExtension=yes])
 AC_ARG_ENABLE(config-dbus,    AS_HELP_STRING([--disable-config-dbus], [Build D-BUS support (default: auto)]), [CONFIG_DBUS_API=$enableval], [CONFIG_DBUS_API=auto])
+AC_ARG_ENABLE(config-hal,     AS_HELP_STRING([--disable-config-hal], [Build HAL support (default: auto)]), [CONFIG_HAL=$enableval], [CONFIG_HAL=auto])
 AC_ARG_ENABLE(xfree86-utils,     AS_HELP_STRING([--enable-xfree86-utils], [Build xfree86 DDX utilities (default: enabled)]), [XF86UTILS=$enableval], [XF86UTILS=yes])
 
 dnl DDXes.
@@ -637,14 +638,29 @@ if test "x$CONFIG_DBUS_API" = xyes; then
 	fi
 
 	AC_DEFINE(CONFIG_DBUS_API, 1, [Use the D-Bus input configuration API])
-	CONFIG_LIB='$(top_builddir)/config/libconfig.a'
 	NEED_DBUS="yes"
 fi
 AM_CONDITIONAL(CONFIG_DBUS_API, [test "x$CONFIG_DBUS_API" = xyes])
 
+PKG_CHECK_MODULES(HAL, hal, [HAVE_HAL=yes], [HAVE_HAL=no])
+if test "x$CONFIG_HAL" = xauto; then
+	CONFIG_HAL="$HAVE_HAL"
+fi
+if test "x$CONFIG_HAL" = xyes; then
+	if ! test "x$HAVE_HAL" = xyes; then
+		AC_MSG_ERROR([HAL hotplug API requested, but HAL is not installed.])
+	fi
+
+	AC_DEFINE(CONFIG_HAL, 1, [Use the HAL hotplug API])
+        REQUIRED_LIBS="$REQUIRED_LIBS hal"
+	NEED_DBUS="yes"
+fi
+AM_CONDITIONAL(CONFIG_HAL, [test "x$CONFIG_HAL" = xyes])
+
 if test "x$NEED_DBUS" = xyes; then
 	REQUIRED_LIBS="$REQUIRED_LIBS dbus-1"
 fi
+CONFIG_LIB='$(top_builddir)/config/libconfig.a'
 
 AM_CONDITIONAL(XV, [test "x$XV" = xyes])
 if test "x$XV" = xyes; then
diff --git a/dix/devices.c b/dix/devices.c
index 57e93bb..923bc0d 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -149,6 +149,7 @@ AddInputDevice(DeviceProc deviceProc, Bo
 #ifdef XKB
     dev->xkb_interest = NULL;
 #endif
+    dev->config_info = NULL;
     dev->nPrivates = 0;
     dev->devPrivates = NULL;
     dev->unwrapProc = NULL;
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index a26abac..ad97605 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -471,6 +471,9 @@
 /* Support the D-Bus hotplug API */
 #undef CONFIG_DBUS_API
 
+/* Support HAL for hotplug */
+#undef CONFIG_HAL
+
 /* Use only built-in fonts */
 #undef BUILTIN_FONTS
 
diff --git a/include/inputstr.h b/include/inputstr.h
index 8f4e9b9..3398949 100644
--- a/include/inputstr.h
+++ b/include/inputstr.h
@@ -326,6 +326,7 @@ typedef struct _DeviceIntRec {
 #else
     void                *pad0;
 #endif
+    char                *config_info; /* used by the hotplug layer */
     DevUnion		*devPrivates;
     int			nPrivates;
     DeviceUnwrapProc    unwrapProc;
diff-tree aa75b3481724834da2f855d8dd2ff36074bd5706 (from 4d238c5c67461ed747aa6c021d1532734f4c63fe)
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Wed Aug 1 01:09:07 2007 +0300

    Hotplug: D-Bus: Dispatch harder
    
    Dispatch until we've got nothing left to dispatch, since apparently
    dispatching will only ever fire a single message ...

diff --git a/config/dbus-core.c b/config/dbus-core.c
index b90e413..5cc80e3 100644
--- a/config/dbus-core.c
+++ b/config/dbus-core.c
@@ -51,8 +51,12 @@ wakeup_handler(pointer data, int err, po
 {
     struct dbus_core_info *info = data;
 
-    if (info->connection && FD_ISSET(info->fd, (fd_set *) read_mask))
-        dbus_connection_read_write_dispatch(info->connection, 0);
+    if (info->connection && FD_ISSET(info->fd, (fd_set *) read_mask)) {
+        do {
+            dbus_connection_read_write_dispatch(info->connection, 0);
+        } while (dbus_connection_get_dispatch_status(info->connection) ==
+                  DBUS_DISPATCH_DATA_REMAINS);
+    }
 }
 
 static void
diff-tree 4d238c5c67461ed747aa6c021d1532734f4c63fe (from 7c9e8fd56e1830f7a971187d14877ebbdf35c4b0)
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Wed Aug 1 01:08:26 2007 +0300

    Input: GetPointerEvents: Deny events from devices without valuators
    
    For some reason, my keyboard has 25 mouse buttons, but zero valuators.  This
    causes GPE to blow up spectacularly, trying to get (and set) co-ordinates from
    devices without valuators.  For now, just prevent this from ever happening,
    and whack a dirty great FIXME in.

diff --git a/dix/getevents.c b/dix/getevents.c
index 8a4f8ed..67990f2 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -499,14 +499,18 @@ GetPointerEvents(xEvent *events, DeviceI
     if ((type == ButtonPress || type == ButtonRelease) && !pDev->button)
         return 0;
 
+    /* FIXME: I guess it should, in theory, be possible to post button events
+     *        from devices without valuators. */
+    if (!pDev->valuator)
+        return 0;
+
     if (!coreOnly && pDev->coreEvents)
         num_events = 2;
     else
         num_events = 1;
 
-    if (type == MotionNotify && num_valuators <= 0) {
+    if (type == MotionNotify && num_valuators <= 0)
         return 0;
-    }
 
     /* Do we need to send a DeviceValuator event? */
     if (!coreOnly && sendValuators) {
diff-tree 7c9e8fd56e1830f7a971187d14877ebbdf35c4b0 (from 0afeb0241a83796575da827bd81375c99ff10af5)
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Wed Aug 1 00:19:14 2007 +0300

    Input: Allow enabling and disabling of devices
    
    Add DEVICE_ENABLE to KDrive and XFree86 to allow us to enable and disable
    devices on the fly.

diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index e3c3abc..cfd162f 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -2294,6 +2294,7 @@ ChangeDeviceControl(register ClientPtr c
         return Success;
 
     case DEVICE_CORE:
+    case DEVICE_ENABLE:
         return Success;
 
     default:
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index b9f7aed..f8feeef 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -297,6 +297,7 @@ ChangeDeviceControl (ClientPtr client, D
       case DEVICE_RESOLUTION:
       case DEVICE_ABS_CALIB:
       case DEVICE_ABS_AREA:
+      case DEVICE_ENABLE:
         return Success;
       default:
         return BadMatch;
diff-tree 0afeb0241a83796575da827bd81375c99ff10af5 (from 62ec6d09b3adaea82ff52c8672e6f611c15ec56d)
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Sun Jul 8 20:48:57 2007 +0300

    DIX: Clean up null root cursor handling
    
    Move the null root cursor handling out of main() and into CreateRootCursor.

diff --git a/dix/cursor.c b/dix/cursor.c
index 5ab562e..d903124 100644
--- a/dix/cursor.c
+++ b/dix/cursor.c
@@ -430,25 +430,41 @@ AllocGlyphCursor(Font source, unsigned s
  *************************************************************/
 
 CursorPtr 
-CreateRootCursor(char *pfilename, unsigned glyph)
+CreateRootCursor(char *unused1, unsigned int unused2)
 {
     CursorPtr 	curs;
+#ifdef NULL_ROOT_CURSOR
+    CursorMetricRec cm;
+#else
     FontPtr 	cursorfont;
     int	err;
     XID		fontID;
+#endif
 
+#ifdef NULL_ROOT_CURSOR
+    cm.width = 0;
+    cm.height = 0;
+    cm.xhot = 0;
+    cm.yhot = 0;
+
+    curs = AllocCursor(NULL, NULL, &cm, 0, 0, 0, 0, 0, 0);
+
+    if (curs == NullCursor)
+        return NullCursor;
+#else
     fontID = FakeClientID(0);
     err = OpenFont(serverClient, fontID, FontLoadAll | FontOpenSync,
-	(unsigned)strlen( pfilename), pfilename);
+	(unsigned)strlen(defaultCursorFont), defaultCursorFont);
     if (err != Success)
 	return NullCursor;
 
     cursorfont = (FontPtr)LookupIDByType(fontID, RT_FONT);
     if (!cursorfont)
 	return NullCursor;
-    if (AllocGlyphCursor(fontID, glyph, fontID, glyph + 1,
+    if (AllocGlyphCursor(fontID, 0, fontID, 1,
 			 0, 0, 0, ~0, ~0, ~0, &curs, serverClient) != Success)
 	return NullCursor;
+#endif
 
     if (!AddResource(FakeClientID(0), RT_CURSOR, (pointer)curs))
 	return NullCursor;
diff --git a/dix/main.c b/dix/main.c
index c5d3783..9fe822b 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -411,22 +411,10 @@ main(int argc, char *argv[], char *envp[
 	    FatalError("could not open default font '%s'", defaultTextFont);
 	}
 
-#ifdef NULL_ROOT_CURSOR
-        cm.width = 0;
-        cm.height = 0;
-        cm.xhot = 0;
-        cm.yhot = 0;
-
-        if (!(rootCursor = AllocCursor(NULL, NULL, &cm, 0, 0, 0, 0, 0, 0))) {
-            FatalError("could not create empty root cursor");
-	}
-        AddResource(FakeClientID(0), RT_CURSOR, (pointer)rootCursor);
-#else
-	if (!(rootCursor = CreateRootCursor(defaultCursorFont, 0))) {
+	if (!(rootCursor = CreateRootCursor(NULL, 0))) {
 	    FatalError("could not open default cursor font '%s'",
 		       defaultCursorFont);
 	}
-#endif
 
 #ifdef DPMSExtension
  	/* check all screens, looking for DPMS Capabilities */
diff-tree 62ec6d09b3adaea82ff52c8672e6f611c15ec56d (from 4d3379d418a781938358e511fd41deb4115a032c)
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Sun Jul 8 20:47:28 2007 +0300

    dix.h: Remove duplicate ffs() prototype.

diff --git a/include/dix.h b/include/dix.h
index 2d452d1..c1d609a 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -640,7 +640,4 @@ typedef struct {
 extern int xstrcasecmp(char *s1, char *s2);
 #endif
 
-/* ffs.c */
-extern int ffs(int i);
-
 #endif /* DIX_H */
diff-tree 4d3379d418a781938358e511fd41deb4115a032c (from 9ac7e8a559fe6008cafc95e8264680c50e72ba19)
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Sun Jul 8 14:31:35 2007 +0300

    Fonts: Fix builtin fonts
    
    Make sure the font path is always 'built-ins' when we use built-in fonts,
    rather than having it as a fixed path for a while, then clobbering it
    halfway through startup.

diff --git a/configure.ac b/configure.ac
index dfa2b54..96439c7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -836,6 +836,7 @@ fi
 if test "x$BUILTIN_FONTS" = xyes; then
        AC_DEFINE(BUILTIN_FONTS, 1, [Use only built-in fonts])
        AC_DEFINE(NOFONTSERVERACCESS, 1, [Avoid using a font server])
+       FONTPATH="built-ins"
 fi
 
 if test "x$XCALIBRATE" = xyes && test "$KDRIVE" = yes; then
diff --git a/dix/main.c b/dix/main.c
index 48d16b1..c5d3783 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -399,14 +399,10 @@ main(int argc, char *argv[], char *envp[
 	    FatalError("failed to initialize core devices");
 
 	InitFonts();
-#ifdef BUILTIN_FONTS
-        defaultFontPath = "built-ins";
-#else
 	if (loadableFonts) {
 	    SetFontPath(0, 0, (unsigned char *)defaultFontPath, &error);
-	} else 
-#endif
-        {
+	}
+        else {
 	    if (SetDefaultFontPath(defaultFontPath) != Success)
 		ErrorF("failed to set default font path '%s'",
 			defaultFontPath);
@@ -414,6 +410,7 @@ main(int argc, char *argv[], char *envp[
 	if (!SetDefaultFont(defaultTextFont)) {
 	    FatalError("could not open default font '%s'", defaultTextFont);
 	}
+
 #ifdef NULL_ROOT_CURSOR
         cm.width = 0;
         cm.height = 0;
@@ -430,6 +427,7 @@ main(int argc, char *argv[], char *envp[
 		       defaultCursorFont);
 	}
 #endif
+
 #ifdef DPMSExtension
  	/* check all screens, looking for DPMS Capabilities */
  	DPMSCapableFlag = DPMSSupported();
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 666a424..bf7dac6 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -982,7 +982,9 @@ OsVendorInit()
   signal(SIGCHLD, SIG_DFL);	/* Need to wait for child processes */
 #endif
   OsDelayInitColors = TRUE;
+#ifndef BUILTIN_FONTS
   loadableFonts = TRUE;
+#endif
 
   if (!beenHere)
     xf86LogInit();
diff-tree 9ac7e8a559fe6008cafc95e8264680c50e72ba19 (from 1cdadc2f43d9069572814510d04b1a560c488fcb)
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Sun Jul 8 14:30:53 2007 +0300

    Hotplug: D-Bus: API version 2
    
    Use uint32s instead of int32s where practical, and add an API version
    request.  Also, try to return all devices added, not just the first,
    and box device arguments.

diff --git a/config/dbus-api b/config/dbus-api
index 654c22b..018e986 100644
--- a/config/dbus-api
+++ b/config/dbus-api
@@ -1,4 +1,4 @@
-D-BUS Configuration API v0.1
+D-BUS Configuration API v2
 ----------------------------
 
 The X server will register the bus name org.x.config.displayN, and the 
@@ -7,6 +7,9 @@ object /org/x/config/N, where N is the d
 Currently only hotplugging of input devices is supported.
 
 org.x.config.input:
+    org.x.config.input.version:
+        Returns one unsigned int32, which is the API version.
+
     org.x.config.input.add:
         Takes an argument of key/value option pairs in arrays, e.g.:
          [ss][ss][ss][ss]
@@ -15,18 +18,18 @@ org.x.config.input:
         Option names beginning with _ are not allowed; they are reserved
         for internal use.
 
-        Returns one signed int32, which is the device id of the new device.
-        If the return value is a negative number, it represents the X
-        Status, as defined in X.h. BadMatch will be returned if the options
+        Returns a number of signed int32s.  Positive integers are the
+        device IDs of new devices; negative numbers are X error codes,
+        as defined in X.h.  BadMatch will be returned if the options
         given do not match any device.  BadValue is returned for a malformed
-        message.  (Example: 8 is new device id 8. -8 is BadMatch.)
+        message.  (Example: 8 is new device ID 8; -8 is BadMatch.)
 
         Notably, BadAlloc is never returned: the server internally signals
         to D-BUS that the attempt failed for lack of memory.
 
     org.x.config.input.remove:
-        Takes one int32 argument, which is the device ID to remove, i.e.:
-         i
+        Takes one uint32 argument, which is the device ID to remove, i.e.:
+         u
         is the signature.
 
         Returns one signed int32 which represents an X status as defined in
@@ -34,4 +37,4 @@ org.x.config.input:
 
     org.x.config.input.listDevices:
         Lists the currently active devices. No argument. 
-        Return value is sequence of <id> <name> <id> <name> ...
+        Return value is sequence of [<id> <name>] [<id> <name>] ..., i.e. [us].
diff --git a/config/dbus.c b/config/dbus.c
index 2450e0c..861aa8e 100644
--- a/config/dbus.c
+++ b/config/dbus.c
@@ -36,7 +36,7 @@
 #include "input.h"
 #include "inputstr.h"
 
-#define API_VERSION 1
+#define API_VERSION 2
 
 #define MATCH_RULE "type='method_call',interface='org.x.config.input'"
 
@@ -156,11 +156,17 @@ add_device(DBusMessage *message, DBusMes
         goto unwind;
     }
 
-    if (!dbus_message_iter_append_basic(&reply_iter, DBUS_TYPE_INT32,
-                                        &dev->id)) {
-        ErrorF("[config/dbus] couldn't append to iterator\n");
-        ret = BadAlloc;
-        goto unwind;
+    /* XXX: If we fail halfway through, we don't seem to have any way to
+     *      empty the iterator, so you'll end up with some device IDs,
+     *      plus an error.  This seems to be a shortcoming in the D-Bus
+     *      API. */
+    for (; dev; dev = dev->next) {
+        if (!dbus_message_iter_append_basic(&reply_iter, DBUS_TYPE_INT32,
+                                            &dev->id)) {
+            ErrorF("[config/dbus] couldn't append to iterator\n");
+            ret = BadAlloc;
+            goto unwind;
+        }
     }
 
 unwind:
@@ -198,7 +204,7 @@ remove_device(DBusMessage *message, DBus
     }
     dbus_message_iter_init_append(reply, &reply_iter);
 
-    if (!dbus_message_get_args(message, error, DBUS_TYPE_INT32,
+    if (!dbus_message_get_args(message, error, DBUS_TYPE_UINT32,
                                &deviceid, DBUS_TYPE_INVALID)) {
         MALFORMED_MESSAGE_ERROR();
     }
@@ -232,21 +238,45 @@ static int
 list_devices(DBusMessage *message, DBusMessage *reply, DBusError *error)
 {
     DeviceIntPtr dev;
-    DBusMessageIter iter;
+    DBusMessageIter iter, subiter;
 
     dbus_message_iter_init_append(reply, &iter);
 
     for (dev = inputInfo.devices; dev; dev = dev->next) {
-        if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32,
+        if (!dbus_message_iter_open_container(&iter, DBUS_TYPE_STRUCT, NULL,
+                                              &subiter)) {
+            ErrorF("[config/dbus] couldn't init container\n");
+            return BadAlloc;
+        }
+        if (!dbus_message_iter_append_basic(&subiter, DBUS_TYPE_UINT32,
                                             &dev->id)) {
             ErrorF("[config/dbus] couldn't append to iterator\n");
             return BadAlloc;
         }
-        if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING,
+        if (!dbus_message_iter_append_basic(&subiter, DBUS_TYPE_STRING,
                                             &dev->name)) {
             ErrorF("[config/dbus] couldn't append to iterator\n");
             return BadAlloc;
         }
+        if (!dbus_message_iter_close_container(&iter, &subiter)) {
+            ErrorF("[config/dbus] couldn't close container\n");
+            return BadAlloc;
+        }
+    }
+
+    return Success;
+}
+
+static int
+get_version(DBusMessage *message, DBusMessage *reply, DBusError *error)
+{
+    DBusMessageIter iter;
+    unsigned int version = API_VERSION;
+
+    dbus_message_iter_init_append(reply, &iter);
+    if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_UINT32, &version)) {
+        ErrorF("[config/dbus] couldn't append version\n");
+        return BadAlloc;
     }
 
     return Success;
@@ -282,6 +312,8 @@ message_handler(DBusConnection *connecti
         err = remove_device(message, reply, &error);
     else if (strcmp(dbus_message_get_member(message), "listDevices") == 0)
         err = list_devices(message, reply, &error);
+    else if (strcmp(dbus_message_get_member(message), "version") == 0)
+        err = get_version(message, reply, &error);
     else
         goto err_reply;
 
diff-tree 1cdadc2f43d9069572814510d04b1a560c488fcb (from 8bfa41e1bf3f588780d7e9f6f900b1fde0570a7e)
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Sun Jul 8 14:28:58 2007 +0300

    Hotplug: Separate D-Bus into core and hotplug API components
    
    Break up D-Bus into two components: a D-Bus core that can be used by any
    part of the server (for the moment, just the D-Bus hotplug API, and the
    forthcoming HAL hotplug API), and the old D-Bus hotplug API.

diff --git a/config/Makefile.am b/config/Makefile.am
index 43c9aa3..5270344 100644
--- a/config/Makefile.am
+++ b/config/Makefile.am
@@ -1,10 +1,19 @@
 AM_CFLAGS = @DIX_CFLAGS@
 
+noinst_LIBRARIES = libconfig.a
+libconfig_a_SOURCES = config.c
+
+if HAVE_DBUS
+AM_CFLAGS += @DBUS_CFLAGS@
+libconfig_a_SOURCES += dbus-core.c
+endif
+
+if CONFIG_DBUS_API
 dbusconfigdir = $(sysconfdir)/dbus-1/system.d
 dbusconfig_DATA = xorg-server.conf
 
 noinst_LIBRARIES = libconfig.a
-
-libconfig_a_SOURCES = config.c
+libconfig_a_SOURCES += dbus.c
+endif
 
 EXTRA_DIST = xorg-server.conf
diff --git a/config/config-backends.h b/config/config-backends.h
new file mode 100644
index 0000000..8a10a3e
--- /dev/null
+++ b/config/config-backends.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright © 2006-2007 Daniel Stone
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of the copyright holders and/or authors
+ * not be used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.  The copyright holders
+ * and/or authors make no representations about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS AND/OR AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND/OR AUTHORS BE LIABLE
+ * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifdef HAVE_DBUS
+#include <dbus/dbus.h>
+
+typedef void (*config_dbus_core_connect_hook)(DBusConnection *connection,
+                                              void *data);
+typedef void (*config_dbus_core_disconnect_hook)(void *data);
+
+struct config_dbus_core_hook {
+    config_dbus_core_connect_hook connect;
+    config_dbus_core_disconnect_hook disconnect;
+    void *data;
+
+    struct config_dbus_core_hook *next;
+};
+
+int config_dbus_core_init(void);
+void config_dbus_core_fini(void);
+int config_dbus_core_add_hook(struct config_dbus_core_hook *hook);
+void config_dbus_core_remove_hook(struct config_dbus_core_hook *hook);
+#endif
+
+#ifdef CONFIG_DBUS_API
+int config_dbus_init(void);
+void config_dbus_fini(void);
+#endif
diff --git a/config/config.c b/config/config.c
index 9b38faf..a6d36c0 100644
--- a/config/config.c
+++ b/config/config.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2006 Daniel Stone
+ * Copyright © 2006-2007 Daniel Stone
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -25,490 +25,28 @@
 #include <dix-config.h>
 #endif
 
-#ifdef HAVE_DBUS
-#define DBUS_API_SUBJECT_TO_CHANGE
-#include <dbus/dbus.h>
-#include <string.h>
-#include <sys/select.h>
-
-#include <X11/X.h>
-
-#include "opaque.h" /* for 'display': there has to be a better way */
-                    /* the above comment lies.  there is no better way. */
-#include "input.h"
-#include "inputstr.h"
 #include "hotplug.h"
-#include "os.h"
-
-#define CONFIG_MATCH_RULE "type='method_call',interface='org.x.config.input'"
-
-#define MALFORMED_MSG "[config] malformed message, dropping"
-#define MALFORMED_MESSAGE() { DebugF(MALFORMED_MSG "\n"); \
-                            ret = BadValue; \
-                            goto unwind; }
-#define MALFORMED_MESSAGE_ERROR() { DebugF(MALFORMED_MSG ": %s, %s", \
-                                       error->name, error->message); \
-                                  ret = BadValue; \
-                                  goto unwind; }
-
-/* How often to attempt reconnecting when we get booted off the bus. */
-#define RECONNECT_DELAY 10000 /* in ms */
-
-struct config_data {
-    int fd;
-    DBusConnection *connection;
-    char busobject[32];
-    char busname[64];
-};
-
-static struct config_data *configData;
-
-static CARD32 configReconnect(OsTimerPtr timer, CARD32 time, pointer arg);
-
-static void
-configWakeupHandler(pointer blockData, int err, pointer pReadMask)
-{
-    struct config_data *data = blockData;
-
-    if (data->connection && FD_ISSET(data->fd, (fd_set *) pReadMask))
-        dbus_connection_read_write_dispatch(data->connection, 0);
-}
-
-static void
-configBlockHandler(pointer data, struct timeval **tv, pointer pReadMask)
-{
-}
-
-static void
-configTeardown(void)
-{
-    if (configData) {
-        RemoveGeneralSocket(configData->fd);
-        RemoveBlockAndWakeupHandlers(configBlockHandler, configWakeupHandler,
-                                     configData);
-        xfree(configData);
-        configData = NULL;
-    }
-}
-
-static int
-configAddDevice(DBusMessage *message, DBusMessageIter *iter, 
-                DBusMessage *reply, DBusMessageIter *r_iter,
-                DBusError *error)
-{
-    DBusMessageIter subiter;
-    InputOption *tmpo = NULL, *options = NULL;
-    char *tmp = NULL;
-    int ret = BadMatch;
-    DeviceIntPtr dev = NULL;
-
-    DebugF("[config] adding device\n");
-
-    /* signature should be [ss][ss]... */
-    options = (InputOption *) xcalloc(sizeof(InputOption), 1);
-    if (!options) {
-        ErrorF("[config] couldn't allocate option\n");
-        return BadAlloc;
-    }
-
-    options->key = xstrdup("_source");
-    options->value = xstrdup("client/dbus");
-    if(!options->key || !options->value) {
-        ErrorF("[config] couldn't allocate first key/value pair\n");
-        ret = BadAlloc;
-        goto unwind;
-    }
-
-    while (dbus_message_iter_get_arg_type(iter) == DBUS_TYPE_ARRAY) {
-        tmpo = (InputOption *) xcalloc(sizeof(InputOption), 1);
-        if (!tmpo) {
-            ErrorF("[config] couldn't allocate option\n");
-            ret = BadAlloc;
-            goto unwind;
-        }
-        tmpo->next = options;
-        options = tmpo;
-
-        dbus_message_iter_recurse(iter, &subiter);
-
-        if (dbus_message_iter_get_arg_type(&subiter) != DBUS_TYPE_STRING)
-            MALFORMED_MESSAGE();
-
-        dbus_message_iter_get_basic(&subiter, &tmp);
-        if (!tmp)
-            MALFORMED_MESSAGE();
-        if (tmp[0] == '_') {
-            ErrorF("[config] attempted subterfuge: option name %s given\n",
-                   tmp);
-            MALFORMED_MESSAGE();
-        }
-        options->key = xstrdup(tmp);
-        if (!options->key) {
-            ErrorF("[config] couldn't duplicate key!\n");
-            ret = BadAlloc;
-            goto unwind;
-        }
-
-        if (!dbus_message_iter_has_next(&subiter))
-            MALFORMED_MESSAGE();
-        dbus_message_iter_next(&subiter);
-        if (dbus_message_iter_get_arg_type(&subiter) != DBUS_TYPE_STRING)
-            MALFORMED_MESSAGE();
-
-        dbus_message_iter_get_basic(&subiter, &tmp);
-        if (!tmp)
-            MALFORMED_MESSAGE();
-        options->value = xstrdup(tmp);
-        if (!options->value) {
-            ErrorF("[config] couldn't duplicate option!\n");
-            ret = BadAlloc;
-            goto unwind;
-        }
-
-        dbus_message_iter_next(iter);
-    }
-
-    ret = NewInputDeviceRequest(options, &dev);
-    if (ret != Success) {
-        DebugF("[config] NewInputDeviceRequest failed\n");
-        goto unwind;
-    }
-
-    if (!dev) {
-        DebugF("[config] NewInputDeviceRequest succeeded, without device\n"); 
-        ret = BadMatch;
-        goto unwind;
-    }
-
-    if (!dbus_message_iter_append_basic(r_iter, DBUS_TYPE_INT32, &(dev->id))) {
-        ErrorF("[config] couldn't append to iterator\n");
-        ret = BadAlloc;
-        goto unwind;
-    }
-
-unwind:
-    if (dev && ret != Success)
-        RemoveDevice(dev);
-
-    while (options) {
-        tmpo = options;
-        options = options->next;
-        if (tmpo->key)
-            xfree(tmpo->key);
-        if (tmpo->value)
-            xfree(tmpo->value);
-        xfree(tmpo);
-    }
-
-    return ret;
-}
-
-static int
-configRemoveDevice(DBusMessage *message, DBusMessageIter *iter,
-                   DBusError *error)
-{
-    int deviceid = -1;
-    int ret = BadMatch;
-    DeviceIntPtr pDev = NULL;
-
-    if (!dbus_message_get_args(message, error, DBUS_TYPE_INT32,
-                               &deviceid, DBUS_TYPE_INVALID)) {
-        MALFORMED_MESSAGE_ERROR();
-    }
-
-    if (deviceid < 0 || !(pDev = LookupDeviceIntRec(deviceid))) {
-        DebugF("[config] bogus device id %d given\n", deviceid);
-        ret = BadMatch;
-        goto unwind;
-    }
-
-    DebugF("[config] removing device %s (id %d)\n", pDev->name, deviceid);
-
-    /* Call PIE here so we don't try to dereference a device that's
-     * already been removed. */
-    OsBlockSignals();
-    ProcessInputEvents();
-    DeleteInputDeviceRequest(pDev);
-    OsReleaseSignals();
-
-    return Success;
-
-unwind:
-    return ret;
-}
-
-static int
-configListDevices(DBusMessage *message, DBusMessageIter *iter,
-                   DBusMessage *reply, DBusMessageIter *r_iter,
-                   DBusError *error)
-{
-    DeviceIntPtr d;
-    int ret = BadMatch;
-
-    for (d = inputInfo.devices; d; d = d->next) {
-        if (!dbus_message_iter_append_basic(r_iter, DBUS_TYPE_INT32,
-                                            &(d->id))) {
-            ErrorF("[config] couldn't append to iterator\n");
-            ret = BadAlloc;
-            goto unwind;
-        }
-        if (!dbus_message_iter_append_basic(r_iter, DBUS_TYPE_STRING,
-                                            &(d->name))) {
-            ErrorF("[config] couldn't append to iterator\n");
-            ret = BadAlloc;
-            goto unwind;
-        }
-    }
-
-unwind:
-    return ret;
-}
-
-static DBusHandlerResult
-configMessage(DBusConnection *connection, DBusMessage *message, void *closure)
-{
-    DBusMessageIter iter;
-    DBusError error;
-    DBusMessage *reply;
-    DBusMessageIter r_iter;
-    DBusConnection *bus = closure;
-    int ret = BadDrawable; /* nonsensical value */
-
-    dbus_error_init(&error);
-
-    DebugF("[config] received a message\n");
-
-    if (strcmp(dbus_message_get_interface(message),
-               "org.x.config.input") == 0) {
-
-        if (!(reply = dbus_message_new_method_return(message))) {
-            ErrorF("[config] failed to create the reply message\n");
-            dbus_error_free(&error);
-            return DBUS_HANDLER_RESULT_NEED_MEMORY;
-        }
-        dbus_message_iter_init_append(reply, &r_iter);
-
-        /* listDevices doesn't take any arguments */
-        if (strcmp(dbus_message_get_member(message), "listDevices") == 0)
-            ret = configListDevices(message, NULL, reply, &r_iter, &error);
-        else 
-        {
-            if (!dbus_message_iter_init(message, &iter)) {
-                ErrorF("[config] failed to init iterator\n");
-                dbus_message_unref(reply);
-                dbus_error_free(&error);
-                return DBUS_HANDLER_RESULT_NEED_MEMORY; /* ?? */
-            }
-
-            if (strcmp(dbus_message_get_member(message), "add") == 0)
-                ret = configAddDevice(message, &iter, reply, &r_iter, &error);
-            else if (strcmp(dbus_message_get_member(message), "remove") == 0)
-                ret = configRemoveDevice(message, &iter, &error);
-        }
-
-        if (ret != BadDrawable && ret != BadAlloc) {
-            if (!strlen(dbus_message_get_signature(reply)))
-            {
-                ret = -ret; /* return errors as negative numbers */
-                if (!dbus_message_iter_append_basic(&r_iter, DBUS_TYPE_INT32, &ret)) {
-                    ErrorF("[config] couldn't append to iterator\n");
-                    dbus_message_unref(reply);
-                    dbus_error_free(&error);
-                    return DBUS_HANDLER_RESULT_HANDLED;
-                }
-            }
-
-            if (!dbus_connection_send(bus, reply, NULL))
-                ErrorF("[config] failed to send reply\n");
-        }
-        dbus_message_unref(reply);
-        dbus_connection_flush(bus);
-    }
-
-    dbus_error_free(&error);
-
-    if (ret == BadAlloc)
-        return DBUS_HANDLER_RESULT_NEED_MEMORY;
-    else if (ret == BadDrawable)
-        return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-    else
-        return DBUS_HANDLER_RESULT_HANDLED;
-}
-
-/**
- * This is a filter, which only handles the disconnected signal, which
- * doesn't go to the normal message handling function.  This takes
- * precedence over the message handling function, so have have to be
- * careful to ignore anything we don't want to deal with here.
- *
- * Yes, this is brutally stupid.
- */
-static DBusHandlerResult
-configFilter(DBusConnection *connection, DBusMessage *message, void *closure)
-{
-    if (dbus_message_is_signal(message, DBUS_INTERFACE_LOCAL,
-                                    "Disconnected")) {
-        ErrorF("[dbus] disconnected from bus\n");
-        TimerSet(NULL, 0, RECONNECT_DELAY, configReconnect, NULL);
-        configTeardown();
-        return DBUS_HANDLER_RESULT_HANDLED;
-    }
-
-    return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-}
-
-static Bool
-configSetup(void)
-{
-    DBusError error;
-    DBusObjectPathVTable vtable = { .message_function = configMessage };
-
-    if (!configData)
-        configData = (struct config_data *) xcalloc(sizeof(struct config_data), 1);
-    if (!configData) {
-        ErrorF("[dbus] failed to allocate data struct\n");
-        return FALSE;
-    }
-
-    dbus_error_init(&error);
-    configData->connection = dbus_bus_get(DBUS_BUS_SYSTEM, &error);
-    if (!configData->connection || dbus_error_is_set(&error)) {
-        DebugF("[dbus] some kind of error occurred while connecting: %s (%s)\n",
-               error.name, error.message);
-        dbus_error_free(&error);
-        xfree(configData);
-        configData = NULL;
-        return FALSE;
-    }
-
-    dbus_connection_set_exit_on_disconnect(configData->connection, FALSE);
-
-    if (!dbus_connection_get_unix_fd(configData->connection, &configData->fd)) {
-        dbus_connection_unref(configData->connection);
-        ErrorF("[dbus] couldn't get fd for bus\n");
-        dbus_error_free(&error);
-        xfree(configData);
-        configData = NULL;
-        return FALSE;
-    }
-
-    snprintf(configData->busname, sizeof(configData->busname),
-             "org.x.config.display%d", atoi(display));
-    if (!dbus_bus_request_name(configData->connection, configData->busname,
-                               0, &error) || dbus_error_is_set(&error)) {
-        ErrorF("[dbus] couldn't take over org.x.config: %s (%s)\n",
-               error.name, error.message);
-        dbus_error_free(&error);
-        dbus_connection_unref(configData->connection);
-        xfree(configData);
-        configData = NULL;
-        return FALSE;
-    }
-
-    /* blocks until we get a reply. */
-    dbus_bus_add_match(configData->connection, CONFIG_MATCH_RULE, &error);
-    if (dbus_error_is_set(&error)) {
-        ErrorF("[dbus] couldn't match X.Org rule: %s (%s)\n", error.name,
-               error.message);
-        dbus_error_free(&error);
-        dbus_bus_release_name(configData->connection, configData->busname,
-                              &error);
-        dbus_connection_unref(configData->connection);
-        xfree(configData);
-        configData = NULL;
-        return FALSE;
-    }
-
-    if (!dbus_connection_add_filter(configData->connection, configFilter,
-                                    configData, NULL)) {
-
-        ErrorF("[dbus] couldn't add signal filter: %s (%s)\n", error.name,
-               error.message);
-        dbus_error_free(&error);
-        dbus_bus_release_name(configData->connection, configData->busname,
-                              &error);
-        dbus_bus_remove_match(configData->connection, CONFIG_MATCH_RULE,
-                              &error);
-        dbus_connection_unref(configData->connection);
-        xfree(configData);
-        configData = NULL;
-        return FALSE;
-    }
-
-    snprintf(configData->busobject, sizeof(configData->busobject),
-             "/org/x/config/%d", atoi(display));
-    if (!dbus_connection_register_object_path(configData->connection,
-                                              configData->busobject, &vtable,
-                                              configData->connection)) {
-        ErrorF("[dbus] couldn't register object path\n");
-        dbus_bus_release_name(configData->connection, configData->busname,
-                              &error);
-        dbus_bus_remove_match(configData->connection, CONFIG_MATCH_RULE,
-                              &error);
-        dbus_connection_unref(configData->connection);
-        dbus_error_free(&error);
-        xfree(configData);
-        configData = NULL;
-        return FALSE;
-    }
-
-    DebugF("[dbus] registered object path %s\n", configData->busobject);
-
-    dbus_error_free(&error);
-    AddGeneralSocket(configData->fd);
-
-    RegisterBlockAndWakeupHandlers(configBlockHandler, configWakeupHandler,
-                                   configData);
-
-    return TRUE;
-}
-
-static CARD32
-configReconnect(OsTimerPtr timer, CARD32 time, pointer arg)
-{
-    if (configSetup())
-        return 0;
-    else
-        return RECONNECT_DELAY;
-}
-
-void
-configInitialise(void)
-{
-    TimerSet(NULL, 0, 1, configReconnect, NULL);
-}
+#include "config-backends.h"
 
 void
-configFini(void)
+config_init()
 {
-    DBusError error;
-
-    if (configData) {
-        dbus_error_init(&error);
-        dbus_connection_unregister_object_path(configData->connection,
-                                               configData->busobject);
-        dbus_connection_remove_filter(configData->connection, configFilter,
-                                      configData);
-        dbus_bus_remove_match(configData->connection, CONFIG_MATCH_RULE,
-                              &error);
-        dbus_bus_release_name(configData->connection, configData->busname,
-                              &error);
-        dbus_connection_unref(configData->connection);
-        dbus_error_free(&error);
-        configTeardown();
+#if defined(CONFIG_DBUS_API)
+    if (config_dbus_core_init()) {
+       if (!config_dbus_init())
+	    ErrorF("[config] failed to initialise D-Bus API\n");
     }
-}
-
-#else /* !HAVE_DBUS */
-
-void
-configInitialise()
-{
+    else {
+	ErrorF("[config] failed to initialise D-Bus core\n");
+    }
+#endif
 }
 
 void
-configFini()
+config_fini()
 {
+#if defined(CONFIG_DBUS_API)
+    config_dbus_fini();
+    config_dbus_core_fini();
+#endif
 }
-
-#endif /* HAVE_DBUS */
diff --git a/config/dbus-core.c b/config/dbus-core.c
new file mode 100644
index 0000000..b90e413
--- /dev/null
+++ b/config/dbus-core.c
@@ -0,0 +1,233 @@
+/*
+ * Copyright © 2006-2007 Daniel Stone
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of the copyright holders and/or authors
+ * not be used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.  The copyright holders
+ * and/or authors make no representations about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS AND/OR AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND/OR AUTHORS BE LIABLE
+ * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#define DBUS_API_SUBJECT_TO_CHANGE
+#include <dbus/dbus.h>
+#include <sys/select.h>
+
+#include "config-backends.h"
+#include "dix.h"
+#include "os.h"
+
+/* How often to attempt reconnecting when we get booted off the bus. */
+#define RECONNECT_DELAY (10 * 1000) /* in ms */
+
+struct dbus_core_info {
+    int fd;
+    DBusConnection *connection;
+    OsTimerPtr timer;
+    struct config_dbus_core_hook *hooks;
+};
+static struct dbus_core_info bus_info;
+
+static CARD32 reconnect_timer(OsTimerPtr timer, CARD32 time, pointer arg);
+
+static void
+wakeup_handler(pointer data, int err, pointer read_mask)
+{
+    struct dbus_core_info *info = data;
+
+    if (info->connection && FD_ISSET(info->fd, (fd_set *) read_mask))
+        dbus_connection_read_write_dispatch(info->connection, 0);
+}
+
+static void
+block_handler(pointer data, struct timeval **tv, pointer read_mask)
+{
+}
+
+/**
+ * Disconnect (if we haven't already been forcefully disconnected), clean up
+ * after ourselves, and call all registered disconnect hooks.
+ */
+static void
+teardown(void)
+{
+    struct config_dbus_core_hook *hook;
+
+    if (bus_info.timer) {
+        TimerCancel(bus_info.timer);
+        bus_info.timer = NULL;
+    }
+
+    /* We should really have pre-disconnect hooks and run them here, for
+     * completeness.  But then it gets awkward, given that you can't
+     * guarantee that they'll be called ... */
+    if (bus_info.connection)
+        dbus_connection_unref(bus_info.connection);
+
+    RemoveBlockAndWakeupHandlers(block_handler, wakeup_handler, &bus_info);
+    RemoveGeneralSocket(bus_info.fd);
+    bus_info.fd = -1;
+    bus_info.connection = NULL;
+
+    for (hook = bus_info.hooks; hook; hook = hook->next) {
+        if (hook->disconnect)
+            hook->disconnect(hook->data);
+    }
+}
+
+/**
+ * This is a filter, which only handles the disconnected signal, which
+ * doesn't go to the normal message handling function.  This takes
+ * precedence over the message handling function, so have have to be
+ * careful to ignore anything we don't want to deal with here.
+ */
+static DBusHandlerResult
+message_filter(DBusConnection *connection, DBusMessage *message, void *data)
+{
+    /* If we get disconnected, then take everything down, and attempt to
+     * reconnect immediately (assuming it's just a restart).  The
+     * connection isn't valid at this point, so throw it out immediately. */
+    if (dbus_message_is_signal(message, DBUS_INTERFACE_LOCAL,
+                                    "Disconnected")) {
+        DebugF("[config/dbus-core] disconnected from bus\n");
+        bus_info.connection = NULL;
+        teardown();
+
+        bus_info.timer = TimerSet(NULL, 0, 1, reconnect_timer, NULL);
+
+        return DBUS_HANDLER_RESULT_HANDLED;
+    }
+
+    return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+}
+
+/**
+ * Attempt to connect to the system bus, and set a filter to deal with
+ * disconnection (see message_filter above).
+ *
+ * @return 1 on success, 0 on failure.
+ */
+static int
+connect_to_bus(void)
+{
+    DBusError error;
+    struct config_dbus_core_hook *hook;
+
+    dbus_error_init(&error);
+    bus_info.connection = dbus_bus_get(DBUS_BUS_SYSTEM, &error);
+    if (!bus_info.connection || dbus_error_is_set(&error)) {
+        DebugF("[config/dbus-core] error connecting to system bus: %s (%s)\n",
+               error.name, error.message);
+        goto err_begin;
+    }
+
+    /* Thankyou.  Really, thankyou. */
+    dbus_connection_set_exit_on_disconnect(bus_info.connection, FALSE);
+
+    if (!dbus_connection_get_unix_fd(bus_info.connection, &bus_info.fd)) {
+        ErrorF("[config/dbus-core] couldn't get fd for system bus\n");
+        goto err_unref;
+    }
+
+    if (!dbus_connection_add_filter(bus_info.connection, message_filter,
+                                    &bus_info, NULL)) {
+        ErrorF("[config/dbus-core] couldn't add filter: %s (%s)\n", error.name,
+               error.message);
+        goto err_fd;
+    }
+
+    dbus_error_free(&error);
+    AddGeneralSocket(bus_info.fd);
+
+    RegisterBlockAndWakeupHandlers(block_handler, wakeup_handler, &bus_info);
+
+    for (hook = bus_info.hooks; hook; hook = hook->next) {
+        if (hook->connect)
+            hook->connect(bus_info.connection, hook->data);
+    }
+
+    return 1;
+
+err_fd:
+    bus_info.fd = -1;
+err_unref:
+    dbus_connection_unref(bus_info.connection);
+    bus_info.connection = NULL;
+err_begin:
+    dbus_error_free(&error);
+
+    return 0;
+}
+
+static CARD32
+reconnect_timer(OsTimerPtr timer, CARD32 time, pointer arg)
+{
+    if (connect_to_bus()) {
+        bus_info.timer = NULL;
+        return 0;
+    }
+    else {
+        return RECONNECT_DELAY;
+    }
+}
+
+int
+config_dbus_core_add_hook(struct config_dbus_core_hook *hook)
+{
+    struct config_dbus_core_hook **prev;
+
+    for (prev = &bus_info.hooks; *prev; prev = &(*prev)->next)
+        ;
+    *prev = hook;
+
+    /* If we're already connected, call the connect hook. */
+    if (bus_info.connection)
+        hook->connect(bus_info.connection, hook->data);
+
+    return 1;
+}
+
+void
+config_dbus_core_remove_hook(struct config_dbus_core_hook *hook)
+{
+    struct config_dbus_core_hook **prev;
+
+    for (prev = &bus_info.hooks; *prev; prev = &(*prev)->next) {
+        if (*prev == hook)
+            *prev = hook->next;
+    }
+}
+
+int
+config_dbus_core_init(void)
+{
+    memset(&bus_info, 0, sizeof(bus_info));
+    bus_info.fd = -1;
+    bus_info.hooks = NULL;
+    bus_info.connection = NULL;
+    bus_info.timer = TimerSet(NULL, 0, 1, reconnect_timer, NULL);
+
+    return 1;
+}
+
+void
+config_dbus_core_fini(void)
+{
+    teardown();
+}
diff --git a/config/dbus.c b/config/dbus.c
new file mode 100644
index 0000000..2450e0c
--- /dev/null
+++ b/config/dbus.c
@@ -0,0 +1,407 @@
+/*
+ * Copyright © 2006-2007 Daniel Stone
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of the copyright holders and/or authors
+ * not be used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.  The copyright holders
+ * and/or authors make no representations about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS AND/OR AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND/OR AUTHORS BE LIABLE
+ * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#define DBUS_API_SUBJECT_TO_CHANGE
+#include <dbus/dbus.h>
+#include <string.h>
+
+#include <X11/X.h>
+
+#include "config-backends.h"
+#include "opaque.h" /* for 'display': there should be a better way. */
+#include "input.h"
+#include "inputstr.h"
+
+#define API_VERSION 1
+
+#define MATCH_RULE "type='method_call',interface='org.x.config.input'"
+
+#define MALFORMED_MSG "[config/dbus] malformed message, dropping"
+#define MALFORMED_MESSAGE() { DebugF(MALFORMED_MSG "\n"); \
+                            ret = BadValue; \
+                            goto unwind; }
+#define MALFORMED_MESSAGE_ERROR() { DebugF(MALFORMED_MSG ": %s, %s", \
+                                       error->name, error->message); \
+                                  ret = BadValue; \
+                                  goto unwind; }
+
+struct connection_info {
+    char busobject[32];
+    char busname[64];
+    DBusConnection *connection;
+};
+
+static void
+reset_info(struct connection_info *info)
+{
+    info->connection = NULL;
+    info->busname[0] = '\0';
+    info->busobject[0] = '\0';
+}
+
+static int
+add_device(DBusMessage *message, DBusMessage *reply, DBusError *error)
+{
+    DBusMessageIter iter, reply_iter, subiter;
+    InputOption *tmpo = NULL, *options = NULL;
+    char *tmp = NULL;
+    int ret, err;
+    DeviceIntPtr dev = NULL;
+
+    if (!dbus_message_iter_init(message, &iter)) {
+        ErrorF("[config/dbus] couldn't initialise iterator\n");
+        return BadAlloc;
+    }
+    dbus_message_iter_init_append(reply, &reply_iter);
+
+    options = xcalloc(sizeof(*options), 1);
+    if (!options) {
+        ErrorF("[config/dbus] couldn't allocate option\n");
+        return BadAlloc;
+    }
+
+    options->key = xstrdup("_source");
+    options->value = xstrdup("client/dbus");
+    if (!options->key || !options->value) {
+        ErrorF("[config/dbus] couldn't allocate first key/value pair\n");
+        ret = BadAlloc;
+        goto unwind;
+    }
+
+    /* signature should be [ss][ss]... */
+    while (dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_ARRAY) {
+        tmpo = xcalloc(sizeof(*tmpo), 1);
+        if (!tmpo) {
+            ErrorF("[config/dbus] couldn't allocate option\n");
+            ret = BadAlloc;
+            goto unwind;
+        }
+        tmpo->next = options;
+        options = tmpo;
+
+        dbus_message_iter_recurse(&iter, &subiter);
+
+        if (dbus_message_iter_get_arg_type(&subiter) != DBUS_TYPE_STRING)
+            MALFORMED_MESSAGE();
+
+        dbus_message_iter_get_basic(&subiter, &tmp);
+        if (!tmp)
+            MALFORMED_MESSAGE();
+        /* The _ prefix refers to internal settings, and may not be given by
+         * the client. */
+        if (tmp[0] == '_') {
+            ErrorF("[config/dbus] attempted subterfuge: option name %s given\n",
+                   tmp);
+            MALFORMED_MESSAGE();
+        }
+        options->key = xstrdup(tmp);
+        if (!options->key) {
+            ErrorF("[config/dbus] couldn't duplicate key!\n");
+            ret = BadAlloc;
+            goto unwind;
+        }
+
+        if (!dbus_message_iter_has_next(&subiter))
+            MALFORMED_MESSAGE();
+        dbus_message_iter_next(&subiter);
+        if (dbus_message_iter_get_arg_type(&subiter) != DBUS_TYPE_STRING)
+            MALFORMED_MESSAGE();
+
+        dbus_message_iter_get_basic(&subiter, &tmp);
+        if (!tmp)
+            MALFORMED_MESSAGE();
+        options->value = xstrdup(tmp);
+        if (!options->value) {
+            ErrorF("[config] couldn't duplicate option!\n");
+            ret = BadAlloc;
+            goto unwind;
+        }
+
+        dbus_message_iter_next(&iter);
+    }
+
+    ret = NewInputDeviceRequest(options, &dev);
+    if (ret != Success) {
+        DebugF("[config/dbus] NewInputDeviceRequest failed\n");
+        goto unwind;
+    }
+
+    if (!dev) {
+        DebugF("[config/dbus] NewInputDeviceRequest provided no device\n");
+        ret = BadImplementation;
+        goto unwind;
+    }
+
+    if (!dbus_message_iter_append_basic(&reply_iter, DBUS_TYPE_INT32,
+                                        &dev->id)) {
+        ErrorF("[config/dbus] couldn't append to iterator\n");
+        ret = BadAlloc;
+        goto unwind;
+    }
+
+unwind:
+    if (ret != Success) {
+        if (dev)
+            RemoveDevice(dev);
+
+        err = -ret;
+        dbus_message_iter_append_basic(&reply_iter, DBUS_TYPE_INT32, &err);
+    }
+
+    while (options) {
+        tmpo = options;
+        options = options->next;
+        if (tmpo->key)
+            xfree(tmpo->key);
+        if (tmpo->value)
+            xfree(tmpo->value);
+        xfree(tmpo);
+    }
+
+    return ret;
+}
+
+static int
+remove_device(DBusMessage *message, DBusMessage *reply, DBusError *error)
+{
+    int deviceid, ret, err;
+    DeviceIntPtr dev;
+    DBusMessageIter iter, reply_iter;
+
+    if (!dbus_message_iter_init(message, &iter)) {
+        ErrorF("[config] failed to init iterator\n");
+        return BadAlloc;
+    }
+    dbus_message_iter_init_append(reply, &reply_iter);
+
+    if (!dbus_message_get_args(message, error, DBUS_TYPE_INT32,
+                               &deviceid, DBUS_TYPE_INVALID)) {
+        MALFORMED_MESSAGE_ERROR();
+    }
+
+    dev = LookupDeviceIntRec(deviceid);
+    if (!dev) {
+        DebugF("[config] bogus device id %d given\n", deviceid);
+        ret = BadMatch;
+        goto unwind;
+    }
+
+    DebugF("[config] removing device %s (id %d)\n", dev->name, deviceid);
+
+    /* Call PIE here so we don't try to dereference a device that's
+     * already been removed. */
+    OsBlockSignals();
+    ProcessInputEvents();
+    DeleteInputDeviceRequest(dev);
+    OsReleaseSignals();
+
+    ret = Success;
+
+unwind:
+    err = (ret == Success) ? ret : -ret;
+    dbus_message_iter_append_basic(&reply_iter, DBUS_TYPE_INT32, &err);
+
+    return ret;
+}
+
+static int
+list_devices(DBusMessage *message, DBusMessage *reply, DBusError *error)
+{
+    DeviceIntPtr dev;
+    DBusMessageIter iter;
+
+    dbus_message_iter_init_append(reply, &iter);
+
+    for (dev = inputInfo.devices; dev; dev = dev->next) {
+        if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32,
+                                            &dev->id)) {
+            ErrorF("[config/dbus] couldn't append to iterator\n");
+            return BadAlloc;
+        }
+        if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING,
+                                            &dev->name)) {
+            ErrorF("[config/dbus] couldn't append to iterator\n");
+            return BadAlloc;
+        }
+    }
+
+    return Success;
+}
+
+static DBusHandlerResult
+message_handler(DBusConnection *connection, DBusMessage *message, void *data)
+{
+    DBusError error;
+    DBusMessage *reply;
+    struct connection_info *info = data;
+
+    /* ret is the overall D-Bus handler result, whereas err is the internal
+     * X error from our individual functions. */
+    int ret = DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+    int err;
+
+    DebugF("[config/dbus] received a message for %s\n",
+           dbus_message_get_interface(message));
+
+    dbus_error_init(&error);
+
+    reply = dbus_message_new_method_return(message);
+    if (!reply) {
+        ErrorF("[config/dbus] failed to create reply\n");
+        ret = DBUS_HANDLER_RESULT_NEED_MEMORY;
+        goto err_start;
+    }
+
+    if (strcmp(dbus_message_get_member(message), "add") == 0)
+        err = add_device(message, reply, &error);
+    else if (strcmp(dbus_message_get_member(message), "remove") == 0)
+        err = remove_device(message, reply, &error);
+    else if (strcmp(dbus_message_get_member(message), "listDevices") == 0)
+        err = list_devices(message, reply, &error);
+    else
+        goto err_reply;
+
+    /* Failure to allocate is a special case. */
+    if (err == BadAlloc) {
+        ret = DBUS_HANDLER_RESULT_NEED_MEMORY;
+        goto err_reply;
+    }
+
+    /* While failure here is always an OOM, we don't return that,
+     * since that would result in devices being double-added/removed. */
+    if (dbus_connection_send(info->connection, reply, NULL))
+        dbus_connection_flush(info->connection);
+    else
+        ErrorF("[config/dbus] failed to send reply\n");
+
+    ret = DBUS_HANDLER_RESULT_HANDLED;
+
+err_reply:
+    dbus_message_unref(reply);
+err_start:
+    dbus_error_free(&error);
+
+    return ret;
+}
+
+static void
+connect_hook(DBusConnection *connection, void *data)
+{
+    DBusError error;
+    DBusObjectPathVTable vtable = { .message_function = message_handler, };
+    struct connection_info *info = data;
+
+    info->connection = connection;
+
+    dbus_error_init(&error);
+
+    if (!dbus_bus_request_name(info->connection, info->busname,
+                               0, &error)) {
+        ErrorF("[config/dbus] couldn't take over org.x.config: %s (%s)\n",
+               error.name, error.message);
+        goto err_start;
+    }
+
+    /* blocks until we get a reply. */
+    dbus_bus_add_match(info->connection, MATCH_RULE, &error);
+    if (dbus_error_is_set(&error)) {
+        ErrorF("[config/dbus] couldn't add match: %s (%s)\n", error.name,
+               error.message);
+        goto err_name;
+    }
+
+    if (!dbus_connection_register_object_path(info->connection,
+                                              info->busobject, &vtable,
+                                              info)) {
+        ErrorF("[config/dbus] couldn't register object path\n");
+        goto err_match;
+    }
+
+    DebugF("[dbus] registered %s, %s\n", info->busname, info->busobject);
+
+    dbus_error_free(&error);
+
+    return;
+
+err_match:
+    dbus_bus_remove_match(info->connection, MATCH_RULE, &error);
+err_name:
+    dbus_bus_release_name(info->connection, info->busname, &error);
+err_start:
+    dbus_error_free(&error);
+
+    reset_info(info);
+}
+
+static void
+disconnect_hook(void *data)
+{
+    struct connection_info *info = data;
+
+    reset_info(info);
+}
+
+#if 0
+void
+pre_disconnect_hook(void)
+{
+    DBusError error;
+
+    dbus_error_init(&error);
+    dbus_connection_unregister_object_path(connection_data->connection,
+                                           connection_data->busobject);
+    dbus_bus_remove_match(connection_data->connection, MATCH_RULE,
+                          &error);
+    dbus_bus_release_name(connection_data->connection,
+                          connection_data->busname, &error);
+    dbus_error_free(&error);
+}
+#endif
+
+static struct connection_info connection_data;
+static struct config_dbus_core_hook core_hook = {
+    .connect = connect_hook,
+    .disconnect = disconnect_hook,
+    .data = &connection_data,
+};
+
+int
+config_dbus_init(void)
+{
+    snprintf(connection_data.busname, sizeof(connection_data.busname),
+             "org.x.config.display%d", atoi(display));
+    snprintf(connection_data.busobject, sizeof(connection_data.busobject),
+             "/org/x/config/%d", atoi(display));
+
+    return config_dbus_core_add_hook(&core_hook);
+}
+
+void
+config_dbus_fini(void)
+{
+    config_dbus_core_remove_hook(&core_hook);
+}
diff --git a/configure.ac b/configure.ac
index d641bfe..dfa2b54 100644
--- a/configure.ac
+++ b/configure.ac
@@ -519,7 +519,7 @@ AC_ARG_ENABLE(fontcache,      AS_HELP_ST
 AC_ARG_ENABLE(dbe,            AS_HELP_STRING([--disable-dbe], [Build DBE extension (default: enabled)]), [DBE=$enableval], [DBE=yes])
 AC_ARG_ENABLE(xf86bigfont,    AS_HELP_STRING([--disable-xf86bigfont], [Build XF86 Big Font extension (default: enabled)]), [XF86BIGFONT=$enableval], [XF86BIGFONT=yes])
 AC_ARG_ENABLE(dpms,           AS_HELP_STRING([--disable-dpms], [Build DPMS extension (default: enabled)]), [DPMSExtension=$enableval], [DPMSExtension=yes])
-AC_ARG_ENABLE(dbus,           AS_HELP_STRING([--disable-dbus], [Build D-BUS support (default: auto)]), [DBUS=$enableval], [DBUS=auto])
+AC_ARG_ENABLE(config-dbus,    AS_HELP_STRING([--disable-config-dbus], [Build D-BUS support (default: auto)]), [CONFIG_DBUS_API=$enableval], [CONFIG_DBUS_API=auto])
 AC_ARG_ENABLE(xfree86-utils,     AS_HELP_STRING([--enable-xfree86-utils], [Build xfree86 DDX utilities (default: enabled)]), [XF86UTILS=$enableval], [XF86UTILS=yes])
 
 dnl DDXes.
@@ -619,17 +619,32 @@ dnl Core modules for most extensions, et
 REQUIRED_MODULES="[randrproto >= 1.2] renderproto [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto xextproto [xproto >= 7.0.9] xtrans [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto [inputproto >= 1.4.2] [kbproto >= 1.0.3]"
 REQUIRED_LIBS="xfont xau fontenc $PIXMAN"
 
-if test "x$DBUS" = xauto; then
-       PKG_CHECK_MODULES(DBUS, dbus-1, [DBUS=yes], [DBUS=no])
+dnl HAVE_DBUS is true if we actually have the D-Bus library, whereas
+dnl CONFIG_DBUS_API is true if we want to enable the D-Bus config
+dnl API.
+PKG_CHECK_MODULES(DBUS, dbus-1, [HAVE_DBUS=yes], [HAVE_DBUS=no])
+if test "x$HAVE_DBUS" = xyes; then
+	AC_DEFINE(HAVE_DBUS, 1, [Have D-Bus support])
 fi
-if test "x$DBUS" = xyes; then
-       PKG_CHECK_MODULES(DBUS, dbus-1)
-       AC_DEFINE(HAVE_DBUS, 1, [Have D-BUS support])
-       REQUIRED_MODULES="$REQUIRED_MODULES dbus-1"
-       REQUIRED_LIBS="$REQUIRED_LIBS dbus-1"
+AM_CONDITIONAL(HAVE_DBUS, [test "x$HAVE_DBUS" = xyes])
+
+if test "x$CONFIG_DBUS_API" = xauto; then
+	CONFIG_DBUS_API="$HAVE_DBUS"
+fi
+if test "x$CONFIG_DBUS_API" = xyes; then
+	if ! test "x$HAVE_DBUS" = xyes; then
+		AC_MSG_ERROR([D-Bus configuration API requested, but D-Bus is not installed.])
+	fi
+
+	AC_DEFINE(CONFIG_DBUS_API, 1, [Use the D-Bus input configuration API])
+	CONFIG_LIB='$(top_builddir)/config/libconfig.a'
+	NEED_DBUS="yes"
+fi
+AM_CONDITIONAL(CONFIG_DBUS_API, [test "x$CONFIG_DBUS_API" = xyes])
+
+if test "x$NEED_DBUS" = xyes; then
+	REQUIRED_LIBS="$REQUIRED_LIBS dbus-1"
 fi
-CONFIG_LIB='$(top_builddir)/config/libconfig.a'
-AM_CONDITIONAL(DBUS, [test "x$DBUS" = xyes])
 
 AM_CONDITIONAL(XV, [test "x$XV" = xyes])
 if test "x$XV" = xyes; then
diff --git a/dix/main.c b/dix/main.c
index 7984137..48d16b1 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -310,7 +310,7 @@ main(int argc, char *argv[], char *envp[
 	InitBlockAndWakeupHandlers();
 	/* Perform any operating system dependent initializations you'd like */
 	OsInit();
-        configInitialise();
+        config_init();
 	if(serverGeneration == 1)
 	{
 	    CreateWellKnownSockets();
@@ -482,7 +482,7 @@ main(int argc, char *argv[], char *envp[
 	FreeAllResources();
 #endif
 
-        configFini();
+        config_fini();
 	CloseDownDevices();
 	for (i = screenInfo.numScreens - 1; i >= 0; i--)
 	{
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 919da60..a26abac 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -465,9 +465,12 @@
 /* Define to 1 if modules should avoid the libcwrapper */
 #undef NO_LIBCWRAPPER
 
-/* Support D-BUS */
+/* Support D-Bus */
 #undef HAVE_DBUS
 
+/* Support the D-Bus hotplug API */
+#undef CONFIG_DBUS_API
+
 /* Use only built-in fonts */
 #undef BUILTIN_FONTS
 
diff --git a/include/hotplug.h b/include/hotplug.h
index 8831b1e..2a72ab9 100644
--- a/include/hotplug.h
+++ b/include/hotplug.h
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2006 Daniel Stone
+ * Copyright © 2006-2007 Daniel Stone
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -21,10 +21,10 @@
  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-#ifndef CONFIG_H
-#define CONFIG_H
+#ifndef HOTPLUG_H
+#define HOTPLUG_H
 
-void configInitialise(void);
-void configFini(void);
+void config_init(void);
+void config_fini(void);
 
-#endif /* CONFIG_H */
+#endif /* HOTPLUG_H */
diff-tree 8bfa41e1bf3f588780d7e9f6f900b1fde0570a7e (from 06dd2748da8b7af343f6cab409b9f351567de5f3)
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Sun Jul 8 04:29:43 2007 +0300

    gitignore: Add automake lex/yacc wrapper

diff --git a/.gitignore b/.gitignore
index 62b5fd6..e4b3d31 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,6 +21,7 @@ install-sh
 libtool
 ltmain.sh
 missing
+ylwrap
 xorg-server.pc
 stamp-h?
 do-not-use-config.h
diff-tree 06dd2748da8b7af343f6cab409b9f351567de5f3 (from fd10312b4224197b937d9e696b53dc2a16c8912f)
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Sun Jul 8 00:27:40 2007 +0300

    configure.ac: Properly check XFree86 proto modules
    
    Not sure why these are conditionals, anyway.  This one really needs
    revisiting, but at least causes configure, rather than the compilation,
    to bomb out.

diff --git a/configure.ac b/configure.ac
index 5566907..d641bfe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1478,6 +1478,7 @@ return 0;}
 	fi
 	if test "x$DGA" = xyes; then
 		XORG_MODULES="$XORG_MODULES xf86dgaproto"
+		PKG_CHECK_MODULES(DGA, xf86dgaproto)
 		AC_DEFINE(DGA, 1, [Support DGA extension])
 		AC_DEFINE(XFreeXDGA, 1, [Build XDGA support])
 	fi
@@ -1487,6 +1488,7 @@ return 0;}
 	fi
 	if test "x$XF86MISC" = xyes; then
 		XORG_MODULES="$XORG_MODULES xf86miscproto"
+		PKG_CHECK_MODULES(XF86MISC, xf86miscproto)
 		AC_DEFINE(XF86MISC, 1, [Support XFree86 miscellaneous extensions])
 	fi
 
@@ -1495,6 +1497,7 @@ return 0;}
 	fi
 	if test "x$XF86VIDMODE" = xyes; then
 		XORG_MODULES="$XORG_MODULES xf86vidmodeproto"
+		PKG_CHECK_MODULES(XF86VIDMODE, xf86vidmodeproto)
 		AC_DEFINE(XF86VIDMODE, 1, [Support XFree86 Video Mode extension])
 	fi
 
diff-tree fd10312b4224197b937d9e696b53dc2a16c8912f (from f37612c6f2375ca904411e6caa0be19fa24f032c)
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Sun Jul 8 00:26:26 2007 +0300

    configure.ac: Fix KDrive VESA/fbdev conditionals
    
    Make sure we actually respect anything explicitly given on the configure
    line, instead of just stomping it with what we detect.

diff --git a/configure.ac b/configure.ac
index be8878a..5566907 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1838,8 +1838,6 @@ AM_CONDITIONAL(XSDLSERVER, [test x"$XSDL
 AM_CONDITIONAL(XEPHYR, [test "x$KDRIVE" = xyes && test "x$XEPHYR" = xyes])
 AM_CONDITIONAL(BUILD_KDRIVEFBDEVLIB, [test "x$KDRIVE" = xyes && test "x$KDRIVEFBDEVLIB" = xyes])
 AM_CONDITIONAL(XFAKESERVER, [test "x$KDRIVE" = xyes && test "x$XFAKE" = xyes])
-AM_CONDITIONAL(KDRIVEVESA, [test x"$ac_cv_header_sys_vm86_h" = xyes])
-AM_CONDITIONAL(KDRIVEFBDEV, [test x"$ac_cv_header_linux_fb_h" = xyes])
 
 dnl these only go in xkb-config.h (which is shared by the Xorg and Xnest servers)
 AC_DEFINE(__XKBDEFRULES__, "xorg", [Default XKB rules])
diff-tree f37612c6f2375ca904411e6caa0be19fa24f032c (from 951c058e7800308f7c472e77178c14400f45c1b3)
Author: Nicolas Trangez <eikke at eikke.com>
Date:   Sun Jul 8 00:23:57 2007 +0300

    Hotplug: Remove unused function definition from hotplug.h
    
    configDispatch hasn't been used in a long time.

diff --git a/include/hotplug.h b/include/hotplug.h
index 0c304b1..8831b1e 100644
--- a/include/hotplug.h
+++ b/include/hotplug.h
@@ -26,6 +26,5 @@
 
 void configInitialise(void);
 void configFini(void);
-void configDispatch(void);
 
 #endif /* CONFIG_H */


More information about the xorg-commit mailing list