From c20c8897272427cb3f755a3e28e80a9ad46f08a1 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 27 Nov 2009 16:01:53 +1000 Subject: [PATCH 1/6] dix: fix memory leak, free event list on shutdown. (#25028) X.Org Bug 25028 Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard --- dix/events.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/dix/events.c b/dix/events.c index 015c2b19f..7e0867c82 100644 --- a/dix/events.c +++ b/dix/events.c @@ -5080,12 +5080,9 @@ InitEvents(void) void CloseDownEvents(void) { - int len; - EventListPtr list; - - len = GetEventList(&list); - while(len--) - xfree(list[len].event); + FreeEventList(InputEventList, InputEventListLen); + InputEventListLen = 0; + InputEventList = NULL; } /** From 83d90b90bcb71c89750f92a177361e53dd261414 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 27 Nov 2009 16:08:44 +1000 Subject: [PATCH 2/6] dix: remove some obsolete comment. The "counterpart to biggest hack" included checking for the motion history function - which is unified in 1.7. Hence the check (which is already removed) would evaluate to true anyway, and this comment isn't needed. Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard --- dix/devices.c | 1 - 1 file changed, 1 deletion(-) diff --git a/dix/devices.c b/dix/devices.c index 3634eece0..bb7b23b83 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -686,7 +686,6 @@ FreeDeviceClass(int type, pointer *class) { ValuatorClassPtr *v = (ValuatorClassPtr*)class; - /* Counterpart to 'biggest hack ever' in init. */ if ((*v)->motion) xfree((*v)->motion); xfree((*v)); From 66bb8c6fbdfc0fc0d971aac4ec6f949bb9288c1b Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 27 Nov 2009 16:20:13 +1000 Subject: [PATCH 3/6] dix: remove core devices when shutting down. (#25028) NewInputDeviceRequest (and RemoveDevice) have checks in place to not allow removal of the VCP/VCK. When shutting down, they need to be cleaned up nonetheless to free the memory associated. X.Org Bug 25028 Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard --- dix/devices.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dix/devices.c b/dix/devices.c index bb7b23b83..6329d2810 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -907,6 +907,9 @@ CloseDownDevices(void) DeleteInputDeviceRequest(dev); } + CloseDevice(inputInfo.pointer); + CloseDevice(inputInfo.keyboard); + inputInfo.devices = NULL; inputInfo.off_devices = NULL; inputInfo.keyboard = NULL; From b584c224a888c9e7f92d7e49021f74232a727c7f Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 30 Oct 2009 12:11:41 +1000 Subject: [PATCH 4/6] Set the source and deviceid for key repeat events (#24785) X.Org Bug 24785 Signed-off-by: Peter Hutterer Acked-by: Adam Jackson --- xkb/xkbAccessX.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c index 2fc764290..0d8e4eb2d 100644 --- a/xkb/xkbAccessX.c +++ b/xkb/xkbAccessX.c @@ -131,6 +131,8 @@ AccessXKeyboardEvent(DeviceIntPtr keybd, event.time = GetTimeInMillis(); event.length = sizeof(DeviceEvent); event.key_repeat = isRepeat; + event.sourceid = keybd->id; + event.deviceid = keybd->id; if (xkbDebugFlags&0x8) { DebugF("[xkb] AXKE: Key %d %s\n", keyCode, From 761ae22f880bd79550ccf93d321b8a28b3755956 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 1 Dec 2009 14:38:19 +1000 Subject: [PATCH 5/6] xfree86: tell users to disable AutoAddDevices, not AllowEmptyInput. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Technically, disabling AEI is the right suggestion. AEI off forces the server to init the built-in defaults for input devices (or pick the first one from the config file). At the same time, hotplugging is still available with AEI off. Unfortunatly, in the vast majority of cases users want to simply disable hotplugging or have a working server while the local HAL configuration is broken or missing. Disabling AEI will lead to duplicate events, triple keystrokes, etc. once the configuration works again. It's not actually required to remove AEI once hotplugging works again, though it will in many cases lead to a setup that appears broken. Asking users to disable AutoAddDevices instead means those users disable hotplugging, can then fix the HAL setup and they _must_ remove the config line again to test if hotplugging works again. Which doesn't leave them with a broken config once everything is working nice and dandy. Less bugreports, everybody wins. Signed-off-by: Peter Hutterer Acked-by: Dan Nicholson Acked-by: Daniel Stone Acked-by: RĂ©mi Cardona Acked-by: James Cloos --- hw/xfree86/common/xf86Config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 40f65bdbf..e1283f97f 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -1456,7 +1456,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) #ifdef CONFIG_HAL xf86Msg(X_INFO, "The server relies on HAL to provide the list of " "input devices.\n\tIf no devices become available, " - "reconfigure HAL or disable AllowEmptyInput.\n"); + "reconfigure HAL or disable AutoAddDevices.\n"); #else xf86Msg(X_INFO, "HAL is disabled and no input devices were configured.\n" "\tTry disabling AllowEmptyInput.\n"); From 91c1bd78f7240c92702828f8e5a6b6ce944b9e36 Mon Sep 17 00:00:00 2001 From: Gaetan Nadon Date: Sat, 28 Nov 2009 21:32:47 -0500 Subject: [PATCH 6/6] configure.ac: error while checking for XDMXCONFIG_DEP Introduced in commit 9998105a387e0294054502331a56e1e020cd93e4 The replacement third parameters to PKG_CHECK_MODULES([DMXMODULES] was not quoted. Signed-off-by: Gaetan Nadon Reviewed-by: Dan Nicholson Tested-by: Julien Cristau Signed-off-by: Peter Hutterer --- configure.ac | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index fcd8875af..6cdef15fb 100644 --- a/configure.ac +++ b/configure.ac @@ -1881,11 +1881,15 @@ AM_CONDITIONAL(XQUARTZ_SPARKLE, [test "x$XQUARTZ_SPARKLE" != "xno"]) AM_CONDITIONAL(STANDALONE_XPBPROXY, [test "x$STANDALONE_XPBPROXY" = xyes]) dnl DMX DDX -PKG_CHECK_MODULES([DMXMODULES], - [xmuu $LIBXEXT x11 xrender xfixes xfont $LIBXI $DMXPROTO xau $XDMCP_MODULES], - PKG_CHECK_MODULES([XDMXCONFIG_DEP], [xaw7 xmu xt xpm x11], [have_dmx=yes], - [have_dmx=no]), - [have_dmx=no]) +PKG_CHECK_MODULES( + [DMXMODULES], + [xmuu $LIBXEXT x11 xrender xfixes xfont $LIBXI $DMXPROTO xau $XDMCP_MODULES], + [PKG_CHECK_MODULES( + [XDMXCONFIG_DEP], + [xaw7 xmu xt xpm x11], + [have_dmx=yes], + [have_dmx=no])], + [have_dmx=no]) AC_MSG_CHECKING([whether to build Xdmx DDX]) if test "x$DMX" = xauto; then DMX="$have_dmx"