xserver: Branch 'master' - 12 commits
Daniel Stone
daniels at kemper.freedesktop.org
Wed Dec 6 23:25:25 EET 2006
config/config.c | 241 ++++++++++++++++++++++++-----------
configure.ac | 4
dix/dispatch.c | 4
dix/events.c | 3
dix/getevents.c | 15 +-
dix/main.c | 6
hw/kdrive/linux/keyboard.c | 3
hw/kdrive/linux/tslib.c | 20 --
hw/kdrive/mga/g400_composite.c | 4
hw/xfree86/Makefile.am | 1
hw/xfree86/common/xf86Xinput.c | 51 +------
hw/xfree86/dixmods/type1mod.c | 15 --
hw/xfree86/doc/man/xorg.conf.man.pre | 2
hw/xfree86/xorgconf.cpp | 1
include/Makefile.am | 2
include/hotplug.h | 0
16 files changed, 203 insertions(+), 169 deletions(-)
New commits:
diff-tree 4ea6dfb984063117eef5c2f931205b1c3eb3108b (from 4cba1a1ebfbdd7ab489b1b1ffb6656cbe88eb61e)
Author: Daniel Stone <daniel at fooishbar.org>
Date: Wed Dec 6 23:24:39 2006 +0200
whitespace police
diff --git a/config/config.c b/config/config.c
index 66a15fc..523327d 100644
--- a/config/config.c
+++ b/config/config.c
@@ -357,7 +357,7 @@ configSetup(void)
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);
diff-tree 4cba1a1ebfbdd7ab489b1b1ffb6656cbe88eb61e (from 0c5dab5c8eaa174f28054b9d20244a709c015210)
Author: Daniel Stone <daniel at fooishbar.org>
Date: Wed Dec 6 23:21:38 2006 +0200
config: bus reconnect support
Add support for reconnecting to the bus when it restarts.
diff --git a/config/config.c b/config/config.c
index 9ecdbb4..66a15fc 100644
--- a/config/config.c
+++ b/config/config.c
@@ -36,10 +36,10 @@
/* the above comment lies. there is no better way. */
#include "input.h"
#include "inputstr.h"
-#include "config.h"
+#include "hotplug.h"
#include "os.h"
-#define MATCH_RULE "type='method_call',interface='org.x.config.input'"
+#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"); \
@@ -50,6 +50,9 @@
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;
@@ -59,6 +62,8 @@ struct config_data {
static struct config_data *configData;
+static CARD32 configReconnect(OsTimerPtr timer, CARD32 time, pointer arg);
+
static void
configWakeupHandler(pointer blockData, int err, pointer pReadMask)
{
@@ -73,6 +78,18 @@ configBlockHandler(pointer data, struct
{
}
+static void
+configTeardown(void)
+{
+ if (configData) {
+ RemoveGeneralSocket(configData->fd);
+ RemoveBlockAndWakeupHandlers(configBlockHandler, configWakeupHandler,
+ configData);
+ xfree(configData);
+ configData = NULL;
+ }
+}
+
static int
configAddDevice(DBusMessage *message, DBusMessageIter *iter, DBusError *error)
{
@@ -226,23 +243,22 @@ configMessage(DBusConnection *connection
ret = configAddDevice(message, &iter, &error);
else if (strcmp(dbus_message_get_member(message), "remove") == 0)
ret = configRemoveDevice(message, &iter, &error);
- }
-
- if (ret != BadDrawable && ret != BadAlloc) {
- reply = dbus_message_new_method_return(message);
- dbus_message_iter_init_append(reply, &iter);
+ if (ret != BadDrawable && ret != BadAlloc) {
+ reply = dbus_message_new_method_return(message);
+ dbus_message_iter_init_append(reply, &iter);
+
+ if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &ret)) {
+ ErrorF("[config] couldn't append to iterator\n");
+ dbus_error_free(&error);
+ return DBUS_HANDLER_RESULT_HANDLED;
+ }
+
+ if (!dbus_connection_send(bus, reply, NULL))
+ ErrorF("[config] failed to send reply\n");
+ dbus_connection_flush(bus);
- if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &ret)) {
- ErrorF("[config] couldn't append to iterator\n");
- dbus_error_free(&error);
- return DBUS_HANDLER_RESULT_HANDLED;
+ dbus_message_unref(reply);
}
-
- if (!dbus_connection_send(bus, reply, NULL))
- ErrorF("[config] failed to send reply\n");
- dbus_connection_flush(bus);
-
- dbus_message_unref(reply);
}
dbus_error_free(&error);
@@ -255,16 +271,40 @@ configMessage(DBusConnection *connection
return DBUS_HANDLER_RESULT_HANDLED;
}
-void
-configInitialise()
+/**
+ * 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)
- return;
+ 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);
@@ -272,15 +312,20 @@ configInitialise()
ErrorF("[dbus] some kind of error occurred: %s (%s)\n", error.name,
error.message);
dbus_error_free(&error);
- return;
+ 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);
- configData->fd = -1;
- return;
+ xfree(configData);
+ configData = NULL;
+ return FALSE;
}
snprintf(configData->busname, sizeof(configData->busname),
@@ -291,12 +336,13 @@ configInitialise()
error.name, error.message);
dbus_error_free(&error);
dbus_connection_unref(configData->connection);
- configData->fd = -1;
- return;
+ xfree(configData);
+ configData = NULL;
+ return FALSE;
}
/* blocks until we get a reply. */
- dbus_bus_add_match(configData->connection, MATCH_RULE, &error);
+ 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);
@@ -304,8 +350,25 @@ configInitialise()
dbus_bus_release_name(configData->connection, configData->busname,
&error);
dbus_connection_unref(configData->connection);
- configData->fd = -1;
- return;
+ 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),
@@ -314,13 +377,15 @@ configInitialise()
configData->busobject, &vtable,
configData->connection)) {
ErrorF("[dbus] couldn't register object path\n");
- configData->fd = -1;
dbus_bus_release_name(configData->connection, configData->busname,
&error);
- dbus_bus_remove_match(configData->connection, MATCH_RULE, &error);
+ dbus_bus_remove_match(configData->connection, CONFIG_MATCH_RULE,
+ &error);
dbus_connection_unref(configData->connection);
dbus_error_free(&error);
- return;
+ xfree(configData);
+ configData = NULL;
+ return FALSE;
}
DebugF("[dbus] registered object path %s\n", configData->busobject);
@@ -330,6 +395,23 @@ configInitialise()
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()
+{
+ TimerSet(NULL, 0, 1, configReconnect, NULL);
}
void
@@ -341,16 +423,15 @@ configFini()
dbus_error_init(&error);
dbus_connection_unregister_object_path(configData->connection,
configData->busobject);
- dbus_bus_remove_match(configData->connection, MATCH_RULE, &error);
+ 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);
- RemoveGeneralSocket(configData->fd);
- RemoveBlockAndWakeupHandlers(configBlockHandler, configWakeupHandler,
- configData);
- xfree(configData);
- configData = NULL;
dbus_error_free(&error);
+ configTeardown();
}
}
diff-tree 0c5dab5c8eaa174f28054b9d20244a709c015210 (from 72e7f2ac6cf0db474d0defa7918f2a3ba76c0e46)
Author: Daniel Stone <daniel at fooishbar.org>
Date: Wed Dec 6 23:21:15 2006 +0200
config: move config.h to hotplug.h
Also, move configInitialise to after OsInit, since the next commit will
make it use a timer.
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 4c5a9b7..0a761eb 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -130,7 +130,6 @@ int ProcInitialConnection();
#include "dispatch.h"
#include "swaprep.h"
#include "swapreq.h"
-#include "config.h"
#ifdef PANORAMIX
#include "panoramiX.h"
#include "panoramiXsrv.h"
diff --git a/dix/main.c b/dix/main.c
index 077fdea..3a77533 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -98,7 +98,7 @@ Equipment Corporation.
#include <X11/fonts/font.h>
#include "opaque.h"
#include "servermd.h"
-#include "config.h"
+#include "hotplug.h"
#include "site.h"
#include "dixfont.h"
#include "extnsionst.h"
@@ -309,9 +309,9 @@ main(int argc, char *argv[], char *envp[
DPMSPowerLevel = 0;
#endif
InitBlockAndWakeupHandlers();
- configInitialise();
/* Perform any operating system dependent initializations you'd like */
- OsInit();
+ OsInit();
+ configInitialise();
if(serverGeneration == 1)
{
CreateWellKnownSockets();
diff --git a/include/Makefile.am b/include/Makefile.am
index 9f07fa6..4289b81 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -7,7 +7,7 @@ sdk_HEADERS = \
closure.h \
colormap.h \
colormapst.h \
- config.h \
+ hotplug.h \
cursor.h \
cursorstr.h \
dix.h \
diff --git a/include/config.h b/include/config.h
deleted file mode 100644
index 0c304b1..0000000
--- a/include/config.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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
- * 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.
- */
-
-#ifndef CONFIG_H
-#define CONFIG_H
-
-void configInitialise(void);
-void configFini(void);
-void configDispatch(void);
-
-#endif /* CONFIG_H */
diff --git a/include/hotplug.h b/include/hotplug.h
new file mode 100644
index 0000000..0c304b1
--- /dev/null
+++ b/include/hotplug.h
@@ -0,0 +1,31 @@
+/*
+ * 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
+ * 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.
+ */
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+void configInitialise(void);
+void configFini(void);
+void configDispatch(void);
+
+#endif /* CONFIG_H */
diff-tree 72e7f2ac6cf0db474d0defa7918f2a3ba76c0e46 (from c458a70d650bd62b8f4706f022d1f3f347636db1)
Author: Daniel Stone <daniel at fooishbar.org>
Date: Wed Dec 6 23:18:52 2006 +0200
GetPointerEvents: always send valuator events for MotionNotify
Always chase a DeviceMotionNotify event with a DeviceValuator, which is
not required in the spec, but will silently break the lib if you don't
include.
diff --git a/dix/getevents.c b/dix/getevents.c
index 9c4ed0e..0150d66 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -484,6 +484,8 @@ GetPointerEvents(xEvent *events, DeviceI
int num_events = 0, final_valuator = 0;
CARD32 ms = 0;
deviceKeyButtonPointer *kbp = NULL;
+ /* Thanks to a broken lib, we _always_ have to chase DeviceMotionNotifies
+ * with DeviceValuators. */
Bool sendValuators = (type == MotionNotify || flags & POINTER_ABSOLUTE);
DeviceIntPtr cp = inputInfo.pointer;
int x = 0, y = 0;
@@ -500,15 +502,16 @@ GetPointerEvents(xEvent *events, DeviceI
else
num_events = 1;
+ if (type == MotionNotify && num_valuators <= 0) {
+ return 0;
+ }
+
/* Do we need to send a DeviceValuator event? */
- if ((num_valuators + first_valuator) > 2 && sendValuators) {
+ if (sendValuators) {
if ((((num_valuators - 1) / 6) + 1) > MAX_VALUATOR_EVENTS)
num_valuators = MAX_VALUATOR_EVENTS * 6;
num_events += ((num_valuators - 1) / 6) + 1;
}
- else if (type == MotionNotify && num_valuators <= 0) {
- return 0;
- }
final_valuator = num_valuators + first_valuator;
@@ -614,7 +617,7 @@ GetPointerEvents(xEvent *events, DeviceI
kbp->root_y = y;
events++;
- if (final_valuator > 2 && sendValuators) {
+ if (sendValuators) {
kbp->deviceid |= MORE_EVENTS;
clipValuators(pDev, first_valuator, num_valuators, valuators);
events = getValuatorEvents(events, pDev, first_valuator,
diff-tree c458a70d650bd62b8f4706f022d1f3f347636db1 (from edabf45425f9ed79547f918cc0dfff4c268de386)
Author: Daniel Stone <daniel at fooishbar.org>
Date: Wed Dec 6 20:30:44 2006 +0200
GetPointerEvents: fix typo
Fix typo that resulted in inverted axes when using an absolute positioning
device that didn't report y, and thus relied on the previous value.
diff --git a/dix/getevents.c b/dix/getevents.c
index 4154262..9c4ed0e 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -540,7 +540,7 @@ GetPointerEvents(xEvent *events, DeviceI
}
else {
if (pDev->coreEvents)
- x = cp->valuator->lasty;
+ y = cp->valuator->lasty;
else
y = pDev->valuator->lasty;
}
diff-tree edabf45425f9ed79547f918cc0dfff4c268de386 (from 8724af248cd6c93182fecd060fed09a556361080)
Author: Daniel Stone <daniel at fooishbar.org>
Date: Sat Dec 2 16:37:19 2006 +0200
configure.ac: add CONFIG_LIB to Xvfb
diff --git a/configure.ac b/configure.ac
index 851194c..002be62 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1059,7 +1059,7 @@ AC_MSG_RESULT([$XVFB])
AM_CONDITIONAL(XVFB, [test "x$XVFB" = xyes])
if test "x$XVFB" = xyes; then
- XVFB_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB $LIBS"
+ XVFB_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB $LIBS"
AC_SUBST([XVFB_LIBS])
fi
diff-tree 8724af248cd6c93182fecd060fed09a556361080 (from 2f0a800ffdc881cdb3adf84f1ed97bbb63cba34c)
Author: Daniel Stone <daniel at fooishbar.org>
Date: Sat Dec 2 16:20:34 2006 +0200
kdrive/mga: fix compiler warning
Change a case that only made one test for an if, preventing the compiler
warning about all other PICT_* types being unsupported.
diff --git a/hw/kdrive/mga/g400_composite.c b/hw/kdrive/mga/g400_composite.c
index 671e517..da2e8b8 100644
--- a/hw/kdrive/mga/g400_composite.c
+++ b/hw/kdrive/mga/g400_composite.c
@@ -286,10 +286,8 @@ mgaCheckComposite(int op, PicturePtr pSr
if (pMaskPicture->componentAlpha)
MGA_FALLBACK(("Component alpha unsupported"));
- switch (pDstPicture->format) {
- case PICT_a8:
+ if (pDstPicture->format == PICT_a8)
MGA_FALLBACK(("render to A8 unsupported"));
- }
return TRUE;
}
diff-tree 2f0a800ffdc881cdb3adf84f1ed97bbb63cba34c (from 99378b58dbc63160382ad9c41f9cb0dd2a24e9d1)
Author: Daniel Stone <daniel at fooishbar.org>
Date: Mon Nov 27 22:22:53 2006 +0200
config: move to block/wakeup handler
diff --git a/config/config.c b/config/config.c
index 05757e2..9ecdbb4 100644
--- a/config/config.c
+++ b/config/config.c
@@ -50,18 +50,27 @@
ret = BadValue; \
goto unwind; }
-static DBusConnection *configConnection = NULL;
-static int configfd = -1;
-static char busobject[32] = { 0 };
-static char busname[64] = { 0 };
+struct config_data {
+ int fd;
+ DBusConnection *connection;
+ char busobject[32];
+ char busname[64];
+};
-void
-configDispatch()
+static struct config_data *configData;
+
+static void
+configWakeupHandler(pointer blockData, int err, pointer pReadMask)
{
- if (!configConnection)
- return;
+ struct config_data *data = blockData;
- dbus_connection_read_write_dispatch(configConnection, 0);
+ 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 int
@@ -249,68 +258,78 @@ configMessage(DBusConnection *connection
void
configInitialise()
{
- DBusConnection *bus = NULL;
DBusError error;
DBusObjectPathVTable vtable = { .message_function = configMessage };
- configConnection = NULL;
+ if (!configData)
+ configData = (struct config_data *) xcalloc(sizeof(struct config_data), 1);
+ if (!configData)
+ return;
dbus_error_init(&error);
- bus = dbus_bus_get(DBUS_BUS_SYSTEM, &error);
- if (!bus || dbus_error_is_set(&error)) {
+ configData->connection = dbus_bus_get(DBUS_BUS_SYSTEM, &error);
+ if (!configData->connection || dbus_error_is_set(&error)) {
ErrorF("[dbus] some kind of error occurred: %s (%s)\n", error.name,
error.message);
dbus_error_free(&error);
return;
}
- if (!dbus_connection_get_unix_fd(bus, &configfd)) {
- dbus_connection_unref(bus);
+ 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);
- configfd = -1;
+ configData->fd = -1;
return;
}
- snprintf(busname, sizeof(busname), "org.x.config.display%d", atoi(display));
- if (!dbus_bus_request_name(bus, busname, 0, &error) ||
- dbus_error_is_set(&error)) {
+ 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(bus);
- configfd = -1;
+ dbus_connection_unref(configData->connection);
+ configData->fd = -1;
return;
}
/* blocks until we get a reply. */
- dbus_bus_add_match(bus, MATCH_RULE, &error);
+ dbus_bus_add_match(configData->connection, 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(bus, busname, &error);
- dbus_connection_unref(bus);
- configfd = -1;
+ dbus_bus_release_name(configData->connection, configData->busname,
+ &error);
+ dbus_connection_unref(configData->connection);
+ configData->fd = -1;
return;
}
- snprintf(busobject, sizeof(busobject), "/org/x/config/%d", atoi(display));
- if (!dbus_connection_register_object_path(bus, busobject, &vtable, bus)) {
+ 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");
- configfd = -1;
- dbus_bus_release_name(bus, busname, &error);
- dbus_bus_remove_match(bus, MATCH_RULE, &error);
- dbus_connection_unref(bus);
+ configData->fd = -1;
+ dbus_bus_release_name(configData->connection, configData->busname,
+ &error);
+ dbus_bus_remove_match(configData->connection, MATCH_RULE, &error);
+ dbus_connection_unref(configData->connection);
dbus_error_free(&error);
return;
}
- DebugF("[dbus] registered object path %s\n", busobject);
+ DebugF("[dbus] registered object path %s\n", configData->busobject);
dbus_error_free(&error);
- configConnection = bus;
- AddGeneralSocket(configfd);
+ AddGeneralSocket(configData->fd);
+
+ RegisterBlockAndWakeupHandlers(configBlockHandler, configWakeupHandler,
+ configData);
}
void
@@ -318,15 +337,19 @@ configFini()
{
DBusError error;
- if (configConnection) {
+ if (configData) {
dbus_error_init(&error);
- dbus_connection_unregister_object_path(configConnection, busobject);
- dbus_bus_remove_match(configConnection, MATCH_RULE, &error);
- dbus_bus_release_name(configConnection, busname, &error);
- dbus_connection_unref(configConnection);
- RemoveGeneralSocket(configfd);
- configConnection = NULL;
- configfd = -1;
+ dbus_connection_unregister_object_path(configData->connection,
+ configData->busobject);
+ dbus_bus_remove_match(configData->connection, MATCH_RULE, &error);
+ dbus_bus_release_name(configData->connection, configData->busname,
+ &error);
+ dbus_connection_unref(configData->connection);
+ RemoveGeneralSocket(configData->fd);
+ RemoveBlockAndWakeupHandlers(configBlockHandler, configWakeupHandler,
+ configData);
+ xfree(configData);
+ configData = NULL;
dbus_error_free(&error);
}
}
@@ -334,11 +357,6 @@ configFini()
#else /* !HAVE_DBUS */
void
-configDispatch()
-{
-}
-
-void
configInitialise()
{
}
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 0a93c3b..4c5a9b7 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -426,9 +426,6 @@ Dispatch(void)
nready = WaitForSomething(clientReady);
- /* this is an enormous hack and NEEDS TO GO AWAY. */
- configDispatch();
-
#ifdef SMART_SCHEDULE
if (nready && !SmartScheduleDisable)
{
diff-tree 99378b58dbc63160382ad9c41f9cb0dd2a24e9d1 (from 8884a73a3f4efa8276c5e38b9573201574c4f1f6)
Author: Daniel Stone <daniel at fooishbar.org>
Date: Mon Nov 27 22:22:33 2006 +0200
kdrive/tslib: remove vendor-specific hacks
Parts of the KDrive merge accidentally contained a bunch of
vendor-specific hacks; sorry.
diff --git a/hw/kdrive/linux/tslib.c b/hw/kdrive/linux/tslib.c
index 44b4b54..41b74fa 100644
--- a/hw/kdrive/linux/tslib.c
+++ b/hw/kdrive/linux/tslib.c
@@ -75,10 +75,7 @@ TsRead (int fd, void *closure)
while (ts_read(private->tsDev, &event, 1) == 1) {
if (event.pressure) {
- if (event.pressure > pi->dixdev->absolute->button_threshold)
- flags = KD_BUTTON_8;
- else
- flags = KD_BUTTON_1;
+ flags = KD_BUTTON_1;
/*
* Here we test for the touch screen driver actually being on the
@@ -113,9 +110,8 @@ TsRead (int fd, void *closure)
static Status
TslibEnable (KdPointerInfo *pi)
{
- struct TslibPrivate *private = pi->driverPrivate;
+ struct TslibPrivate *private = pi->driverPrivate;
- private->holdThumbEvents = 1;
private->raw_event_hook = NULL;
private->raw_event_closure = NULL;
private->tsDev = ts_open(pi->path, 0);
@@ -126,9 +122,6 @@ TslibEnable (KdPointerInfo *pi)
close(private->fd);
return BadAlloc;
}
- if (pi->dixdev && pi->dixdev->absolute &&
- pi->dixdev->absolute->button_threshold == 0)
- pi->dixdev->absolute->button_threshold = 115;
KdRegisterFd(private->fd, TsRead, pi);
@@ -141,12 +134,12 @@ TslibDisable (KdPointerInfo *pi)
{
struct TslibPrivate *private = pi->driverPrivate;
- if (private->fd) {
- KdUnregisterFd(pi, private->fd);
- close(private->fd);
- }
+ if (private->fd)
+ KdUnregisterFd(pi, private->fd, TRUE);
+
if (private->tsDev)
ts_close(private->tsDev);
+
private->fd = 0;
private->tsDev = NULL;
}
@@ -156,7 +149,6 @@ static Status
TslibInit (KdPointerInfo *pi)
{
int fd = 0, i = 0;
- char devpath[PATH_MAX], devname[TS_NAME_SIZE];
DIR *inputdir = NULL;
struct dirent *inputent = NULL;
struct tsdev *tsDev = NULL;
diff-tree 8884a73a3f4efa8276c5e38b9573201574c4f1f6 (from f2903c12bb4bb0b7c94b96c55af8fa55507f9d7d)
Author: Daniel Stone <daniel at fooishbar.org>
Date: Mon Nov 27 22:39:56 2006 +0200
xfree86/input: re-add support for disabling drag events
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index be3368d..16e330d 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -90,16 +90,6 @@
#include "mi.h"
-/******************************************************************************
- * debugging macro
- *****************************************************************************/
-#ifdef DEBUG
-static int debug_level = 0;
-#define DBG(lvl, f) {if ((lvl) <= debug_level) f;}
-#else
-#define DBG(lvl, f)
-#endif
-
xEvent *xf86Events = NULL;
static Bool
@@ -140,33 +130,6 @@ xf86ProcessCommonOptions(LocalDevicePtr
}
}
-void
-xf86AlwaysCoreControl(DeviceIntPtr pDev, IntegerCtrl *control)
-{
-}
-
-/***********************************************************************
- *
- * xf86XinputFinalizeInit --
- *
- * Create and initialize an integer feedback to control the always
- * core feature.
- *
- ***********************************************************************
- */
-void
-xf86XinputFinalizeInit(DeviceIntPtr dev)
-{
- LocalDevicePtr local = (LocalDevicePtr)dev->public.devicePrivate;
-
- if (InitIntegerFeedbackClassDeviceStruct(dev, xf86AlwaysCoreControl) == FALSE) {
- ErrorF("Unable to init integer feedback for always core feature\n");
- } else {
- local->always_core_feedback = dev->intfeed;
- dev->intfeed->ctrl.integer_displayed = (local->flags & XI86_ALWAYS_CORE) ? 1 : 0;
- }
-}
-
/***********************************************************************
*
* xf86ActivateDevice --
@@ -193,8 +156,6 @@ xf86ActivateDevice(LocalDevicePtr local)
dev->public.devicePrivate = (pointer) local;
local->dev = dev;
- xf86XinputFinalizeInit(dev);
-
dev->coreEvents = local->flags & XI86_ALWAYS_CORE;
RegisterOtherDevice(dev);
@@ -435,9 +396,9 @@ xf86PostMotionEvent(DeviceIntPtr device,
va_list var;
int i = 0, nevents = 0;
Bool drag = xf86SendDragEvents(device);
- LocalDevicePtr local = (LocalDevicePtr) device->public.devicePrivate;
int *valuators = NULL;
int flags = 0;
+ xEvent *xE = NULL;
if (is_absolute)
flags = POINTER_ABSOLUTE;
@@ -460,8 +421,14 @@ xf86PostMotionEvent(DeviceIntPtr device,
flags, first_valuator, num_valuators,
valuators);
- for (i = 0; i < nevents; i++)
- mieqEnqueue(device, xf86Events + i);
+ for (i = 0; i < nevents; i++) {
+ xE = xf86Events + i;
+ /* Don't post core motion events for devices not registered to send
+ * drag events. */
+ if (xE->u.u.type != MotionNotify || drag) {
+ mieqEnqueue(device, xf86Events + i);
+ }
+ }
xfree(valuators);
}
diff-tree f2903c12bb4bb0b7c94b96c55af8fa55507f9d7d (from d17ec01e8395a8f14b75a10c8bf082b3f5a4fb36)
Author: Daniel Stone <daniel at fooishbar.org>
Date: Tue Nov 7 11:13:32 2006 +0200
SyntheticMotion: don't dereference sprite.screen when not using Xinerama
(cherry picked from aa052e43c6c293e14f78837e00c6b7581f9713bb commit)
diff --git a/dix/events.c b/dix/events.c
index 7cfe0ad..0a39dcd 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -328,7 +328,8 @@ static void ConfineToShape(RegionPtr sha
static void PostNewCursor(void);
#define SyntheticMotion(x, y) \
- PostSyntheticMotion(x, y, sprite.screen, \
+ PostSyntheticMotion(x, y, noPanoramiXExtension ? 0 : \
+ sprite.screen->myNum, \
syncEvents.playingEvents ? \
syncEvents.time.milliseconds : \
currentTime.milliseconds);
diff --git a/hw/kdrive/linux/keyboard.c b/hw/kdrive/linux/keyboard.c
index b7571f6..ad9907a 100644
--- a/hw/kdrive/linux/keyboard.c
+++ b/hw/kdrive/linux/keyboard.c
@@ -745,14 +745,11 @@ LinuxKeyboardEnable (KdKeyboardInfo *ki)
cfsetispeed(&nTty, 9600);
cfsetospeed(&nTty, 9600);
tcsetattr(fd, TCSANOW, &nTty);
- /* Our kernel cleverly ignores O_NONBLOCK. Sigh. */
-#if 0
/*
* Flush any pending keystrokes
*/
while ((n = read (fd, buf, sizeof (buf))) > 0)
;
-#endif
KdRegisterFd (fd, LinuxKeyboardRead, ki);
return Success;
}
diff-tree d17ec01e8395a8f14b75a10c8bf082b3f5a4fb36 (from abe5e079af715713097ab0daad29a3e9f523c398)
Author: Daniel Stone <daniel at fooishbar.org>
Date: Fri Dec 1 00:41:41 2006 +0200
remove CID support (bug #5553)
Remove CID from all our fontpaths.
(cherry picked from 69820a10e33e4582c192360996e866007114639d commit)
diff --git a/configure.ac b/configure.ac
index 1aa5455..851194c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -391,7 +391,7 @@ AC_ARG_WITH(mesa-source, AS_HELP_STR
AC_ARG_WITH(fontdir, AS_HELP_STRING([--with-fontdir=FONTDIR], [Path to top level dir where fonts are installed (default: ${libdir}/X11/fonts)]),
[ FONTDIR="$withval" ],
[ FONTDIR="${libdir}/X11/fonts" ])
-DEFAULT_FONT_PATH="${FONTDIR}/misc/,${FONTDIR}/TTF/,${FONTDIR}/OTF,${FONTDIR}/Type1/,${FONTDIR}/CID/,${FONTDIR}/100dpi/,${FONTDIR}/75dpi/"
+DEFAULT_FONT_PATH="${FONTDIR}/misc/,${FONTDIR}/TTF/,${FONTDIR}/OTF,${FONTDIR}/Type1/,${FONTDIR}/100dpi/,${FONTDIR}/75dpi/"
AC_ARG_WITH(default-font-path, AS_HELP_STRING([--with-default-font-path=PATH], [Comma separated list of font dirs]),
[ FONTPATH="$withval" ],
[ FONTPATH="${DEFAULT_FONT_PATH}" ])
diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index b373242..0c1306f 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -93,7 +93,6 @@ CPP_FILES_FLAGS = \
-DMISCFONTPATH="\"$(BASE_FONT_PATH)/misc\"" \
-DT1FONTPATH="\"$(BASE_FONT_PATH)/Type1\"" \
-DTRUETYPEFONTPATH="\"$(BASE_FONT_PATH)/TTF\"" \
- -DCIDFONTPATH="\"$(BASE_FONT_PATH)/CID\"" \
-DDPI75FONTPATH="\"$(BASE_FONT_PATH)/75dpi\"" \
-DDPI100FONTPATH="\"$(BASE_FONT_PATH)/100dpi\"" \
-DMODULEPATH=\"$(DEFAULT_MODULE_PATH)\"
diff --git a/hw/xfree86/dixmods/type1mod.c b/hw/xfree86/dixmods/type1mod.c
index 48c1d04..3da53ea 100644
--- a/hw/xfree86/dixmods/type1mod.c
+++ b/hw/xfree86/dixmods/type1mod.c
@@ -57,9 +57,6 @@ static XF86ModuleVersionInfo VersRec =
_X_EXPORT XF86ModuleData type1ModuleData = { &VersRec, type1Setup, NULL };
extern void Type1RegisterFontFileFunctions(void);
-#ifdef BUILDCID
-extern void CIDRegisterFontFileFunctions(void);
-#endif
FontModule type1Module = {
Type1RegisterFontFileFunctions,
@@ -67,23 +64,11 @@ FontModule type1Module = {
NULL
};
-#ifdef BUILDCID
-FontModule CIDModule = {
- CIDRegisterFontFileFunctions,
- "CID",
- NULL
-};
-#endif
-
static pointer
type1Setup(pointer module, pointer opts, int *errmaj, int *errmin)
{
type1Module.module = module;
LoadFont(&type1Module);
-#ifdef BUILDCID
- CIDModule.module = module;
- LoadFont(&CIDModule);
-#endif
/* Need a non-NULL return */
return (pointer)1;
diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre
index abf3146..8d52b2b 100644
--- a/hw/xfree86/doc/man/xorg.conf.man.pre
+++ b/hw/xfree86/doc/man/xorg.conf.man.pre
@@ -311,7 +311,6 @@ font path elements:
.I __projectroot__/lib/X11/fonts/misc/
.I __projectroot__/lib/X11/fonts/TTF/
.I __projectroot__/lib/X11/fonts/Type1/
-.I __projectroot__/lib/X11/fonts/CID/
.I __projectroot__/lib/X11/fonts/75dpi/
.I __projectroot__/lib/X11/fonts/100dpi/
.fi
@@ -326,7 +325,6 @@ The recommended font path contains the f
.I __projectroot__/lib/X11/fonts/75dpi/:unscaled
.I __projectroot__/lib/X11/fonts/100dpi/:unscaled
.I __projectroot__/lib/X11/fonts/Type1/
-.I __projectroot__/lib/X11/fonts/CID/
.I __projectroot__/lib/X11/fonts/Speedo/
.I __projectroot__/lib/X11/fonts/75dpi/
.I __projectroot__/lib/X11/fonts/100dpi/
diff --git a/hw/xfree86/xorgconf.cpp b/hw/xfree86/xorgconf.cpp
index 71abe13..1995045 100644
--- a/hw/xfree86/xorgconf.cpp
+++ b/hw/xfree86/xorgconf.cpp
@@ -56,7 +56,6 @@ XCOMM command (or a combination of both
FontPath MISCFONTPATH
FontPath T1FONTPATH
FontPath TRUETYPEFONTPATH
- FontPath CIDFONTPATH
FontPath DPI75FONTPATH
FontPath DPI100FONTPATH
More information about the xorg-commit
mailing list