|
|
f4aa76c |
diff -up gdm-2.19.5/gui/modules/dwellmouselistener.c.dont-warp-pointer-to-stylus gdm-2.19.5/gui/modules/dwellmouselistener.c
|
|
|
4ce612a |
--- gdm-2.19.5/gui/modules/dwellmouselistener.c.dont-warp-pointer-to-stylus 2007-08-06 11:09:49.000000000 -0400
|
|
|
4ce612a |
+++ gdm-2.19.5/gui/modules/dwellmouselistener.c 2007-08-06 11:22:18.000000000 -0400
|
|
|
4ce612a |
@@ -35,10 +35,6 @@
|
|
|
4ce612a |
|
|
|
4ce612a |
#include <X11/Xlib.h>
|
|
|
4ce612a |
|
|
|
4ce612a |
-#ifdef HAVE_XINPUT
|
|
|
4ce612a |
-#include <X11/extensions/XInput.h>
|
|
|
4ce612a |
-#endif
|
|
|
4ce612a |
-
|
|
|
4ce612a |
/*
|
|
|
4ce612a |
* Note that CONFIGFILE will have to be changed to something more generic
|
|
|
4ce612a |
* if this module is ever moved outside of gdm.
|
|
|
4ce612a |
@@ -90,14 +86,10 @@ extern char **environ;
|
|
|
4ce612a |
|
|
|
4ce612a |
static guint enter_signal_id = 0;
|
|
|
4ce612a |
static guint leave_signal_id = 0;
|
|
|
4ce612a |
-static int xinput_type_motion = 0;
|
|
|
4ce612a |
|
|
|
4ce612a |
static Crossings *crossings = NULL;
|
|
|
4ce612a |
static int cross_pos = 0;
|
|
|
f4aa76c |
static guint max_crossings = 0;
|
|
|
4ce612a |
-static XID *ext_input_devices = NULL;
|
|
|
4ce612a |
-static gint ext_device_count = 0;
|
|
|
f4aa76c |
-static gboolean latch_core_pointer = TRUE;
|
|
|
f4aa76c |
|
|
|
f4aa76c |
static void create_event_watcher (void);
|
|
|
f4aa76c |
static void load_bindings(gchar *path);
|
|
|
4ce612a |
@@ -110,77 +102,6 @@ static gboolean debug_gestures = FALSE;
|
|
|
4ce612a |
BindingType get_binding_type(char c);
|
|
|
4ce612a |
BindingDirection get_binding_direction(char c);
|
|
|
f4aa76c |
|
|
|
4ce612a |
-static gboolean
|
|
|
4ce612a |
-is_ext_device (XID id)
|
|
|
4ce612a |
-{
|
|
|
4ce612a |
- gint i;
|
|
|
4ce612a |
- for (i=0; i < ext_device_count; i++)
|
|
|
4ce612a |
- if (id == ext_input_devices[i])
|
|
|
4ce612a |
- return TRUE;
|
|
|
4ce612a |
-
|
|
|
4ce612a |
- if (debug_gestures)
|
|
|
4ce612a |
- syslog (LOG_WARNING, "is-ext-device failed for %d", (int) id);
|
|
|
4ce612a |
-
|
|
|
4ce612a |
- return FALSE;
|
|
|
4ce612a |
-}
|
|
|
4ce612a |
-
|
|
|
4ce612a |
-static void
|
|
|
4ce612a |
-init_xinput (GdkDisplay *display, GdkWindow *root)
|
|
|
4ce612a |
-{
|
|
|
4ce612a |
-#ifdef HAVE_XINPUT
|
|
|
4ce612a |
- XEventClass event_list[40];
|
|
|
4ce612a |
- int i, j, number = 0, num_devices;
|
|
|
4ce612a |
- XDeviceInfo *devices = NULL;
|
|
|
4ce612a |
- XDevice *device = NULL;
|
|
|
4ce612a |
-
|
|
|
4ce612a |
- devices = XListInputDevices (GDK_DISPLAY_XDISPLAY (display),
|
|
|
4ce612a |
- &num_devices);
|
|
|
4ce612a |
-
|
|
|
4ce612a |
- if (debug_gestures)
|
|
|
4ce612a |
- syslog (LOG_WARNING, "Checking %d input devices...",
|
|
|
4ce612a |
- num_devices);
|
|
|
4ce612a |
-
|
|
|
4ce612a |
- for (i=0; i < num_devices; i++) {
|
|
|
4ce612a |
- if (devices[i].use == IsXExtensionDevice) {
|
|
|
4ce612a |
- device = XOpenDevice (GDK_DISPLAY_XDISPLAY (display),
|
|
|
4ce612a |
- devices[i].id);
|
|
|
4ce612a |
- for (j=0; j < device->num_classes && number < 39; j++) {
|
|
|
4ce612a |
- switch (device->classes[j].input_class)
|
|
|
4ce612a |
- {
|
|
|
4ce612a |
- case ValuatorClass:
|
|
|
4ce612a |
- DeviceMotionNotify (device,
|
|
|
4ce612a |
- xinput_type_motion,
|
|
|
4ce612a |
- event_list[number]);
|
|
|
4ce612a |
- number++;
|
|
|
4ce612a |
- default:
|
|
|
4ce612a |
- break;
|
|
|
4ce612a |
- }
|
|
|
4ce612a |
- }
|
|
|
4ce612a |
- ++ext_device_count;
|
|
|
4ce612a |
-
|
|
|
4ce612a |
- if (ext_input_devices) {
|
|
|
4ce612a |
- ext_input_devices = g_realloc (ext_input_devices,
|
|
|
4ce612a |
- sizeof (XID *) * ext_device_count);
|
|
|
4ce612a |
- } else {
|
|
|
4ce612a |
- ext_input_devices = g_malloc (sizeof (XID *));
|
|
|
4ce612a |
- }
|
|
|
4ce612a |
- ext_input_devices[ext_device_count - 1] = devices[i].id;
|
|
|
4ce612a |
- }
|
|
|
4ce612a |
- }
|
|
|
4ce612a |
-
|
|
|
4ce612a |
- if (debug_gestures)
|
|
|
4ce612a |
- syslog (LOG_WARNING, "%d event types available", number);
|
|
|
4ce612a |
-
|
|
|
4ce612a |
- if (XSelectExtensionEvent (GDK_WINDOW_XDISPLAY (root),
|
|
|
4ce612a |
- GDK_WINDOW_XWINDOW (root),
|
|
|
4ce612a |
- event_list, number)) {
|
|
|
4ce612a |
- if (debug_gestures)
|
|
|
4ce612a |
- syslog (LOG_WARNING,
|
|
|
4ce612a |
- "Can't select input device events!");
|
|
|
4ce612a |
- }
|
|
|
4ce612a |
-#endif
|
|
|
4ce612a |
-}
|
|
|
4ce612a |
-
|
|
|
4ce612a |
static gchar *
|
|
|
4ce612a |
screen_exec_display_string (GdkScreen *screen, const char *old)
|
|
|
4ce612a |
{
|
|
|
4ce612a |
@@ -687,9 +608,6 @@ leave_enter_emission_hook (GSignalInvoca
|
|
|
f4aa76c |
cursor);
|
|
|
f4aa76c |
gdk_cursor_unref (cursor);
|
|
|
f4aa76c |
g_timeout_add (2000, change_cursor_back, NULL);
|
|
|
f4aa76c |
- latch_core_pointer = FALSE;
|
|
|
f4aa76c |
- /* once we've recognized a gesture, we need to *
|
|
|
f4aa76c |
- * leave the pointer alone */
|
|
|
f4aa76c |
|
|
|
f4aa76c |
at_name = strstr (action, "#AT_TYPE=");
|
|
|
f4aa76c |
if (at_name != NULL) {
|
|
|
4ce612a |
@@ -719,25 +637,6 @@ leave_enter_emission_hook (GSignalInvoca
|
|
|
f4aa76c |
return TRUE;
|
|
|
f4aa76c |
}
|
|
|
f4aa76c |
|
|
|
f4aa76c |
-static GdkFilterReturn
|
|
|
f4aa76c |
-gestures_filter (GdkXEvent *gdk_xevent,
|
|
|
f4aa76c |
- GdkEvent *event,
|
|
|
f4aa76c |
- gpointer data)
|
|
|
f4aa76c |
-{
|
|
|
f4aa76c |
- XEvent *xevent = (XEvent *)gdk_xevent;
|
|
|
f4aa76c |
-
|
|
|
f4aa76c |
- if (xevent->type == xinput_type_motion) {
|
|
|
f4aa76c |
- XDeviceMotionEvent *motion = (XDeviceMotionEvent *) xevent;
|
|
|
f4aa76c |
- if ((motion->axes_count < 2) || !is_ext_device (motion->deviceid))
|
|
|
f4aa76c |
- return GDK_FILTER_CONTINUE;
|
|
|
f4aa76c |
- if (latch_core_pointer)
|
|
|
f4aa76c |
- XWarpPointer (motion->display, None,
|
|
|
f4aa76c |
- motion->root,
|
|
|
f4aa76c |
- 0, 0, 0, 0, motion->axis_data[0], motion->axis_data[1]);
|
|
|
f4aa76c |
- }
|
|
|
f4aa76c |
- return GDK_FILTER_CONTINUE;
|
|
|
f4aa76c |
-}
|
|
|
f4aa76c |
-
|
|
|
f4aa76c |
static void
|
|
|
f4aa76c |
create_event_watcher (void)
|
|
|
f4aa76c |
{
|
|
|
4ce612a |
@@ -758,12 +657,6 @@ create_event_watcher (void)
|
|
|
4ce612a |
crossings[i].time = 0;
|
|
|
4ce612a |
}
|
|
|
f4aa76c |
|
|
|
4ce612a |
- init_xinput (display,
|
|
|
4ce612a |
- gdk_screen_get_root_window (
|
|
|
4ce612a |
- gdk_display_get_default_screen (display)));
|
|
|
4ce612a |
-
|
|
|
f4aa76c |
- gdk_window_add_filter (NULL, gestures_filter, NULL);
|
|
|
f4aa76c |
-
|
|
|
f4aa76c |
/* set up emission hook */
|
|
|
f4aa76c |
gtk_type_class (GTK_TYPE_WIDGET);
|
|
|
f4aa76c |
enter_signal_id = g_signal_lookup ("enter-notify-event", GTK_TYPE_WIDGET);
|