summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Cameron <brian.cameron@sun.com>2007-08-15 17:37:19 +0000
committerBrian Cameron <bcameron@src.gnome.org>2007-08-15 17:37:19 +0000
commit67da3fb62e316fe8ed967ff66660092248a20752 (patch)
treea32dfdca10b42cf4c4ed2f7d40c0e54a9fba8c29
parente63d5974f4770f8fc638db495f132f07dac388e1 (diff)
downloadgdm-67da3fb62e316fe8ed967ff66660092248a20752.tar.gz
Remove XInput code from dwellmouselistener.c since it doesn't seem to work
2007-08-15 Brian Cameron <brian.cameron@sun.com> * gui/modules/dwellmouselistener.c: Remove XInput code from dwellmouselistener.c since it doesn't seem to work properly. Now this module assumes that X be configured to send core events for extended input devices. This fixes bug #457998 where a tablet was not working with dwellmouselistener.c. Patch by Ray Strode <rstrode@redhat.com>. svn path=/trunk/; revision=5155
-rw-r--r--ChangeLog9
-rw-r--r--gui/modules/dwellmouselistener.c107
2 files changed, 9 insertions, 107 deletions
diff --git a/ChangeLog b/ChangeLog
index 4da57414..9567a1ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-08-15 Brian Cameron <brian.cameron@sun.com>
+
+ * gui/modules/dwellmouselistener.c: Remove XInput code from
+ dwellmouselistener.c since it doesn't seem to work properly.
+ Now this module assumes that X be configured to send core
+ events for extended input devices. This fixes bug #457998
+ where a tablet was not working with dwellmouselistener.c.
+ Patch by Ray Strode <rstrode@redhat.com>.
+
2007-08-09 Brian Cameron <brian.cameron@sun.com>
* gui/gdmflexiserver.c: We do not want to pop up the
diff --git a/gui/modules/dwellmouselistener.c b/gui/modules/dwellmouselistener.c
index 95c710fb..fea0d37f 100644
--- a/gui/modules/dwellmouselistener.c
+++ b/gui/modules/dwellmouselistener.c
@@ -35,10 +35,6 @@
#include <X11/Xlib.h>
-#ifdef HAVE_XINPUT
-#include <X11/extensions/XInput.h>
-#endif
-
/*
* Note that CONFIGFILE will have to be changed to something more generic
* if this module is ever moved outside of gdm.
@@ -90,14 +86,10 @@ extern char **environ;
static guint enter_signal_id = 0;
static guint leave_signal_id = 0;
-static int xinput_type_motion = 0;
static Crossings *crossings = NULL;
static int cross_pos = 0;
static guint max_crossings = 0;
-static XID *ext_input_devices = NULL;
-static gint ext_device_count = 0;
-static gboolean latch_core_pointer = TRUE;
static void create_event_watcher (void);
static void load_bindings(gchar *path);
@@ -110,77 +102,6 @@ static gboolean debug_gestures = FALSE;
BindingType get_binding_type(char c);
BindingDirection get_binding_direction(char c);
-static gboolean
-is_ext_device (XID id)
-{
- gint i;
- for (i=0; i < ext_device_count; i++)
- if (id == ext_input_devices[i])
- return TRUE;
-
- if (debug_gestures)
- syslog (LOG_WARNING, "is-ext-device failed for %d", (int) id);
-
- return FALSE;
-}
-
-static void
-init_xinput (GdkDisplay *display, GdkWindow *root)
-{
-#ifdef HAVE_XINPUT
- XEventClass event_list[40];
- int i, j, number = 0, num_devices;
- XDeviceInfo *devices = NULL;
- XDevice *device = NULL;
-
- devices = XListInputDevices (GDK_DISPLAY_XDISPLAY (display),
- &num_devices);
-
- if (debug_gestures)
- syslog (LOG_WARNING, "Checking %d input devices...",
- num_devices);
-
- for (i=0; i < num_devices; i++) {
- if (devices[i].use == IsXExtensionDevice) {
- device = XOpenDevice (GDK_DISPLAY_XDISPLAY (display),
- devices[i].id);
- for (j=0; j < device->num_classes && number < 39; j++) {
- switch (device->classes[j].input_class)
- {
- case ValuatorClass:
- DeviceMotionNotify (device,
- xinput_type_motion,
- event_list[number]);
- number++;
- default:
- break;
- }
- }
- ++ext_device_count;
-
- if (ext_input_devices) {
- ext_input_devices = g_realloc (ext_input_devices,
- sizeof (XID *) * ext_device_count);
- } else {
- ext_input_devices = g_malloc (sizeof (XID *));
- }
- ext_input_devices[ext_device_count - 1] = devices[i].id;
- }
- }
-
- if (debug_gestures)
- syslog (LOG_WARNING, "%d event types available", number);
-
- if (XSelectExtensionEvent (GDK_WINDOW_XDISPLAY (root),
- GDK_WINDOW_XWINDOW (root),
- event_list, number)) {
- if (debug_gestures)
- syslog (LOG_WARNING,
- "Can't select input device events!");
- }
-#endif
-}
-
static gchar *
screen_exec_display_string (GdkScreen *screen, const char *old)
{
@@ -685,9 +606,6 @@ leave_enter_emission_hook (GSignalInvocationHint *ihint,
cursor);
gdk_cursor_unref (cursor);
g_timeout_add (2000, change_cursor_back, NULL);
- latch_core_pointer = FALSE;
- /* once we've recognized a gesture, we need to *
- * leave the pointer alone */
}
}
}
@@ -697,25 +615,6 @@ leave_enter_emission_hook (GSignalInvocationHint *ihint,
return TRUE;
}
-static GdkFilterReturn
-gestures_filter (GdkXEvent *gdk_xevent,
- GdkEvent *event,
- gpointer data)
-{
- XEvent *xevent = (XEvent *)gdk_xevent;
-
- if (xevent->type == xinput_type_motion) {
- XDeviceMotionEvent *motion = (XDeviceMotionEvent *) xevent;
- if ((motion->axes_count < 2) || !is_ext_device (motion->deviceid))
- return GDK_FILTER_CONTINUE;
- if (latch_core_pointer)
- XWarpPointer (motion->display, None,
- motion->root,
- 0, 0, 0, 0, motion->axis_data[0], motion->axis_data[1]);
- }
- return GDK_FILTER_CONTINUE;
-}
-
static void
create_event_watcher (void)
{
@@ -736,12 +635,6 @@ create_event_watcher (void)
crossings[i].time = 0;
}
- init_xinput (display,
- gdk_screen_get_root_window (
- gdk_display_get_default_screen (display)));
-
- gdk_window_add_filter (NULL, gestures_filter, NULL);
-
/* set up emission hook */
gtk_type_class (GTK_TYPE_WIDGET);
enter_signal_id = g_signal_lookup ("enter-notify-event", GTK_TYPE_WIDGET);