|
|
b9a760 |
From 5fcfdcb2726637285c256f2b6b8ad75cc619d3a6 Mon Sep 17 00:00:00 2001
|
|
|
b9a760 |
From: "Jasper St. Pierre" <jstpierre@mecheye.net>
|
|
|
b9a760 |
Date: Wed, 10 Jul 2013 16:26:01 -0400
|
|
|
b9a760 |
Subject: [PATCH 1/4] backend-x11: Remove bad branch prediction
|
|
|
b9a760 |
|
|
|
b9a760 |
This will only get once, at in Clutter initialization time.
|
|
|
b9a760 |
|
|
|
b9a760 |
https://bugzilla.gnome.org/show_bug.cgi?id=703969
|
|
|
b9a760 |
---
|
|
|
b9a760 |
clutter/x11/clutter-backend-x11.c | 105 ++++++++++++++++++--------------------
|
|
|
b9a760 |
1 file changed, 51 insertions(+), 54 deletions(-)
|
|
|
b9a760 |
|
|
|
b9a760 |
diff --git a/clutter/x11/clutter-backend-x11.c b/clutter/x11/clutter-backend-x11.c
|
|
|
b9a760 |
index b7cfcc4..9bbfba8 100644
|
|
|
b9a760 |
--- a/clutter/x11/clutter-backend-x11.c
|
|
|
b9a760 |
+++ b/clutter/x11/clutter-backend-x11.c
|
|
|
b9a760 |
@@ -222,71 +222,68 @@ clutter_backend_x11_xsettings_notify (const char *name,
|
|
|
b9a760 |
static void
|
|
|
b9a760 |
clutter_backend_x11_create_device_manager (ClutterBackendX11 *backend_x11)
|
|
|
b9a760 |
{
|
|
|
b9a760 |
- if (G_UNLIKELY (backend_x11->device_manager == NULL))
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- ClutterEventTranslator *translator;
|
|
|
b9a760 |
- ClutterBackend *backend;
|
|
|
b9a760 |
+ ClutterEventTranslator *translator;
|
|
|
b9a760 |
+ ClutterBackend *backend;
|
|
|
b9a760 |
|
|
|
b9a760 |
#if defined(HAVE_XINPUT) || defined(HAVE_XINPUT_2)
|
|
|
b9a760 |
- if (clutter_enable_xinput)
|
|
|
b9a760 |
+ if (clutter_enable_xinput)
|
|
|
b9a760 |
+ {
|
|
|
b9a760 |
+ int event_base, first_event, first_error;
|
|
|
b9a760 |
+
|
|
|
b9a760 |
+ if (XQueryExtension (backend_x11->xdpy, "XInputExtension",
|
|
|
b9a760 |
+ &event_base,
|
|
|
b9a760 |
+ &first_event,
|
|
|
b9a760 |
+ &first_error))
|
|
|
b9a760 |
{
|
|
|
b9a760 |
- int event_base, first_event, first_error;
|
|
|
b9a760 |
+#ifdef HAVE_XINPUT_2
|
|
|
b9a760 |
+ int major = 2;
|
|
|
b9a760 |
+ int minor = 3;
|
|
|
b9a760 |
|
|
|
b9a760 |
- if (XQueryExtension (backend_x11->xdpy, "XInputExtension",
|
|
|
b9a760 |
- &event_base,
|
|
|
b9a760 |
- &first_event,
|
|
|
b9a760 |
- &first_error))
|
|
|
b9a760 |
+ if (XIQueryVersion (backend_x11->xdpy, &major, &minor) != BadRequest)
|
|
|
b9a760 |
{
|
|
|
b9a760 |
-#ifdef HAVE_XINPUT_2
|
|
|
b9a760 |
- int major = 2;
|
|
|
b9a760 |
- int minor = 3;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- if (XIQueryVersion (backend_x11->xdpy, &major, &minor) != BadRequest)
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- CLUTTER_NOTE (BACKEND, "Creating XI2 device manager");
|
|
|
b9a760 |
- backend_x11->has_xinput = TRUE;
|
|
|
b9a760 |
- backend_x11->device_manager =
|
|
|
b9a760 |
- g_object_new (CLUTTER_TYPE_DEVICE_MANAGER_XI2,
|
|
|
b9a760 |
- "backend", backend_x11,
|
|
|
b9a760 |
- "opcode", event_base,
|
|
|
b9a760 |
- NULL);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- backend_x11->xi_minor = minor;
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
- else
|
|
|
b9a760 |
+ CLUTTER_NOTE (BACKEND, "Creating XI2 device manager");
|
|
|
b9a760 |
+ backend_x11->has_xinput = TRUE;
|
|
|
b9a760 |
+ backend_x11->device_manager =
|
|
|
b9a760 |
+ g_object_new (CLUTTER_TYPE_DEVICE_MANAGER_XI2,
|
|
|
b9a760 |
+ "backend", backend_x11,
|
|
|
b9a760 |
+ "opcode", event_base,
|
|
|
b9a760 |
+ NULL);
|
|
|
b9a760 |
+
|
|
|
b9a760 |
+ backend_x11->xi_minor = minor;
|
|
|
b9a760 |
+ }
|
|
|
b9a760 |
+ else
|
|
|
b9a760 |
#endif /* HAVE_XINPUT_2 */
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- CLUTTER_NOTE (BACKEND, "Creating Core+XI device manager");
|
|
|
b9a760 |
- backend_x11->has_xinput = TRUE;
|
|
|
b9a760 |
- backend_x11->device_manager =
|
|
|
b9a760 |
- g_object_new (CLUTTER_TYPE_DEVICE_MANAGER_X11,
|
|
|
b9a760 |
- "backend", backend_x11,
|
|
|
b9a760 |
- "event-base", first_event,
|
|
|
b9a760 |
- NULL);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- backend_x11->xi_minor = -1;
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
+ {
|
|
|
b9a760 |
+ CLUTTER_NOTE (BACKEND, "Creating Core+XI device manager");
|
|
|
b9a760 |
+ backend_x11->has_xinput = TRUE;
|
|
|
b9a760 |
+ backend_x11->device_manager =
|
|
|
b9a760 |
+ g_object_new (CLUTTER_TYPE_DEVICE_MANAGER_X11,
|
|
|
b9a760 |
+ "backend", backend_x11,
|
|
|
b9a760 |
+ "event-base", first_event,
|
|
|
b9a760 |
+ NULL);
|
|
|
b9a760 |
+
|
|
|
b9a760 |
+ backend_x11->xi_minor = -1;
|
|
|
b9a760 |
}
|
|
|
b9a760 |
}
|
|
|
b9a760 |
- else
|
|
|
b9a760 |
+ }
|
|
|
b9a760 |
+ else
|
|
|
b9a760 |
#endif /* HAVE_XINPUT || HAVE_XINPUT_2 */
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- CLUTTER_NOTE (BACKEND, "Creating Core device manager");
|
|
|
b9a760 |
- backend_x11->has_xinput = FALSE;
|
|
|
b9a760 |
- backend_x11->device_manager =
|
|
|
b9a760 |
- g_object_new (CLUTTER_TYPE_DEVICE_MANAGER_X11,
|
|
|
b9a760 |
- "backend", backend_x11,
|
|
|
b9a760 |
- NULL);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- backend_x11->xi_minor = -1;
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- backend = CLUTTER_BACKEND (backend_x11);
|
|
|
b9a760 |
- backend->device_manager = backend_x11->device_manager;
|
|
|
b9a760 |
+ {
|
|
|
b9a760 |
+ CLUTTER_NOTE (BACKEND, "Creating Core device manager");
|
|
|
b9a760 |
+ backend_x11->has_xinput = FALSE;
|
|
|
b9a760 |
+ backend_x11->device_manager =
|
|
|
b9a760 |
+ g_object_new (CLUTTER_TYPE_DEVICE_MANAGER_X11,
|
|
|
b9a760 |
+ "backend", backend_x11,
|
|
|
b9a760 |
+ NULL);
|
|
|
b9a760 |
|
|
|
b9a760 |
- translator = CLUTTER_EVENT_TRANSLATOR (backend_x11->device_manager);
|
|
|
b9a760 |
- _clutter_backend_add_event_translator (backend, translator);
|
|
|
b9a760 |
+ backend_x11->xi_minor = -1;
|
|
|
b9a760 |
}
|
|
|
b9a760 |
+
|
|
|
b9a760 |
+ backend = CLUTTER_BACKEND (backend_x11);
|
|
|
b9a760 |
+ backend->device_manager = backend_x11->device_manager;
|
|
|
b9a760 |
+
|
|
|
b9a760 |
+ translator = CLUTTER_EVENT_TRANSLATOR (backend_x11->device_manager);
|
|
|
b9a760 |
+ _clutter_backend_add_event_translator (backend, translator);
|
|
|
b9a760 |
}
|
|
|
b9a760 |
|
|
|
b9a760 |
static void
|
|
|
b9a760 |
--
|
|
|
b9a760 |
1.8.4.2
|
|
|
b9a760 |
|
|
|
b9a760 |
|
|
|
b9a760 |
From 3239941d36ae9db92424309f9cdeb3d7f064aa97 Mon Sep 17 00:00:00 2001
|
|
|
b9a760 |
From: "Jasper St. Pierre" <jstpierre@mecheye.net>
|
|
|
b9a760 |
Date: Wed, 10 Jul 2013 16:31:57 -0400
|
|
|
b9a760 |
Subject: [PATCH 2/4] x11: Remove support for XInput 1
|
|
|
b9a760 |
|
|
|
b9a760 |
Now we either use core X11 or XInput 2.
|
|
|
b9a760 |
|
|
|
b9a760 |
https://bugzilla.gnome.org/show_bug.cgi?id=703969
|
|
|
b9a760 |
|
|
|
b9a760 |
Conflicts:
|
|
|
b9a760 |
clutter/config.h.win32.in
|
|
|
b9a760 |
---
|
|
|
b9a760 |
clutter/config.h.win32.in | 3 -
|
|
|
b9a760 |
clutter/x11/clutter-backend-x11.c | 31 +--
|
|
|
b9a760 |
clutter/x11/clutter-device-manager-core-x11.c | 230 ----------------
|
|
|
b9a760 |
clutter/x11/clutter-input-device-core-x11.c | 373 --------------------------
|
|
|
b9a760 |
clutter/x11/clutter-input-device-core-x11.h | 5 -
|
|
|
b9a760 |
configure.ac | 6 -
|
|
|
b9a760 |
6 files changed, 7 insertions(+), 641 deletions(-)
|
|
|
b9a760 |
|
|
|
b9a760 |
diff --git a/clutter/config.h.win32.in b/clutter/config.h.win32.in
|
|
|
b9a760 |
index 6040516..e351026 100644
|
|
|
b9a760 |
--- a/clutter/config.h.win32.in
|
|
|
b9a760 |
+++ b/clutter/config.h.win32.in
|
|
|
b9a760 |
@@ -127,9 +127,6 @@
|
|
|
b9a760 |
/* Define to 1 if X Generic Extensions is available */
|
|
|
b9a760 |
/* #undef HAVE_XGE */
|
|
|
b9a760 |
|
|
|
b9a760 |
-/* Define to 1 if XInput is available */
|
|
|
b9a760 |
-/* #undef HAVE_XINPUT */
|
|
|
b9a760 |
-
|
|
|
b9a760 |
/* Define to 1 if XI2 is available */
|
|
|
b9a760 |
/* #undef HAVE_XINPUT_2 */
|
|
|
b9a760 |
|
|
|
b9a760 |
diff --git a/clutter/x11/clutter-backend-x11.c b/clutter/x11/clutter-backend-x11.c
|
|
|
b9a760 |
index 9bbfba8..435370c 100644
|
|
|
b9a760 |
--- a/clutter/x11/clutter-backend-x11.c
|
|
|
b9a760 |
+++ b/clutter/x11/clutter-backend-x11.c
|
|
|
b9a760 |
@@ -50,10 +50,6 @@
|
|
|
b9a760 |
#include <X11/extensions/Xcomposite.h>
|
|
|
b9a760 |
#endif
|
|
|
b9a760 |
|
|
|
b9a760 |
-#if HAVE_XINPUT
|
|
|
b9a760 |
-#include <X11/extensions/XInput.h>
|
|
|
b9a760 |
-#endif
|
|
|
b9a760 |
-
|
|
|
b9a760 |
#if HAVE_XINPUT_2
|
|
|
b9a760 |
#include <X11/extensions/XInput2.h>
|
|
|
b9a760 |
#endif
|
|
|
b9a760 |
@@ -225,7 +221,7 @@ clutter_backend_x11_create_device_manager (ClutterBackendX11 *backend_x11)
|
|
|
b9a760 |
ClutterEventTranslator *translator;
|
|
|
b9a760 |
ClutterBackend *backend;
|
|
|
b9a760 |
|
|
|
b9a760 |
-#if defined(HAVE_XINPUT) || defined(HAVE_XINPUT_2)
|
|
|
b9a760 |
+#ifdef HAVE_XINPUT_2
|
|
|
b9a760 |
if (clutter_enable_xinput)
|
|
|
b9a760 |
{
|
|
|
b9a760 |
int event_base, first_event, first_error;
|
|
|
b9a760 |
@@ -235,7 +231,6 @@ clutter_backend_x11_create_device_manager (ClutterBackendX11 *backend_x11)
|
|
|
b9a760 |
&first_event,
|
|
|
b9a760 |
&first_error))
|
|
|
b9a760 |
{
|
|
|
b9a760 |
-#ifdef HAVE_XINPUT_2
|
|
|
b9a760 |
int major = 2;
|
|
|
b9a760 |
int minor = 3;
|
|
|
b9a760 |
|
|
|
b9a760 |
@@ -251,23 +246,11 @@ clutter_backend_x11_create_device_manager (ClutterBackendX11 *backend_x11)
|
|
|
b9a760 |
|
|
|
b9a760 |
backend_x11->xi_minor = minor;
|
|
|
b9a760 |
}
|
|
|
b9a760 |
- else
|
|
|
b9a760 |
-#endif /* HAVE_XINPUT_2 */
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- CLUTTER_NOTE (BACKEND, "Creating Core+XI device manager");
|
|
|
b9a760 |
- backend_x11->has_xinput = TRUE;
|
|
|
b9a760 |
- backend_x11->device_manager =
|
|
|
b9a760 |
- g_object_new (CLUTTER_TYPE_DEVICE_MANAGER_X11,
|
|
|
b9a760 |
- "backend", backend_x11,
|
|
|
b9a760 |
- "event-base", first_event,
|
|
|
b9a760 |
- NULL);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- backend_x11->xi_minor = -1;
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
}
|
|
|
b9a760 |
}
|
|
|
b9a760 |
- else
|
|
|
b9a760 |
-#endif /* HAVE_XINPUT || HAVE_XINPUT_2 */
|
|
|
b9a760 |
+
|
|
|
b9a760 |
+ if (backend_x11->device_manager == NULL)
|
|
|
b9a760 |
+#endif /* HAVE_XINPUT_2 */
|
|
|
b9a760 |
{
|
|
|
b9a760 |
CLUTTER_NOTE (BACKEND, "Creating Core device manager");
|
|
|
b9a760 |
backend_x11->has_xinput = FALSE;
|
|
|
b9a760 |
@@ -514,14 +497,14 @@ static const GOptionEntry entries[] =
|
|
|
b9a760 |
G_OPTION_ARG_NONE, &clutter_synchronise,
|
|
|
b9a760 |
N_("Make X calls synchronous"), NULL
|
|
|
b9a760 |
},
|
|
|
b9a760 |
-#if defined(HAVE_XINPUT) || defined(HAVE_XINPUT_2)
|
|
|
b9a760 |
+#ifdef HAVE_XINPUT_2
|
|
|
b9a760 |
{
|
|
|
b9a760 |
"disable-xinput", 0,
|
|
|
b9a760 |
G_OPTION_FLAG_REVERSE,
|
|
|
b9a760 |
G_OPTION_ARG_NONE, &clutter_enable_xinput,
|
|
|
b9a760 |
N_("Disable XInput support"), NULL
|
|
|
b9a760 |
},
|
|
|
b9a760 |
-#endif /* HAVE_XINPUT */
|
|
|
b9a760 |
+#endif /* HAVE_XINPUT_2 */
|
|
|
b9a760 |
{ NULL }
|
|
|
b9a760 |
};
|
|
|
b9a760 |
|
|
|
b9a760 |
@@ -1188,7 +1171,7 @@ clutter_x11_get_input_devices (void)
|
|
|
b9a760 |
gboolean
|
|
|
b9a760 |
clutter_x11_has_xinput (void)
|
|
|
b9a760 |
{
|
|
|
b9a760 |
-#if defined(HAVE_XINPUT) || defined(HAVE_XINPUT_2)
|
|
|
b9a760 |
+#ifdef HAVE_XINPUT_2
|
|
|
b9a760 |
ClutterBackend *backend = clutter_get_default_backend ();
|
|
|
b9a760 |
|
|
|
b9a760 |
if (backend == NULL)
|
|
|
b9a760 |
diff --git a/clutter/x11/clutter-device-manager-core-x11.c b/clutter/x11/clutter-device-manager-core-x11.c
|
|
|
b9a760 |
index f470189..6a3606d 100644
|
|
|
b9a760 |
--- a/clutter/x11/clutter-device-manager-core-x11.c
|
|
|
b9a760 |
+++ b/clutter/x11/clutter-device-manager-core-x11.c
|
|
|
b9a760 |
@@ -37,17 +37,6 @@
|
|
|
b9a760 |
#include "clutter-stage-private.h"
|
|
|
b9a760 |
#include "clutter-private.h"
|
|
|
b9a760 |
|
|
|
b9a760 |
-#ifdef HAVE_XINPUT
|
|
|
b9a760 |
-#include <X11/extensions/XInput.h>
|
|
|
b9a760 |
-
|
|
|
b9a760 |
-/* old versions of XI.h don't define these */
|
|
|
b9a760 |
-#ifndef IsXExtensionKeyboard
|
|
|
b9a760 |
-#define IsXExtensionKeyboard 3
|
|
|
b9a760 |
-#define IsXExtensionPointer 4
|
|
|
b9a760 |
-#endif
|
|
|
b9a760 |
-
|
|
|
b9a760 |
-#endif /* HAVE_XINPUT */
|
|
|
b9a760 |
-
|
|
|
b9a760 |
enum
|
|
|
b9a760 |
{
|
|
|
b9a760 |
PROP_0,
|
|
|
b9a760 |
@@ -69,146 +58,6 @@ G_DEFINE_TYPE_WITH_CODE (ClutterDeviceManagerX11,
|
|
|
b9a760 |
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_EVENT_TRANSLATOR,
|
|
|
b9a760 |
clutter_event_translator_iface_init));
|
|
|
b9a760 |
|
|
|
b9a760 |
-#ifdef HAVE_XINPUT
|
|
|
b9a760 |
-static void
|
|
|
b9a760 |
-translate_class_info (ClutterInputDevice *device,
|
|
|
b9a760 |
- XDeviceInfo *info)
|
|
|
b9a760 |
-{
|
|
|
b9a760 |
- XAnyClassPtr any_class;
|
|
|
b9a760 |
- gint i;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- any_class = info->inputclassinfo;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- for (i = 0; i < info->num_classes; i++)
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- switch (any_class->class)
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- case ButtonClass:
|
|
|
b9a760 |
- break;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- case KeyClass:
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- XKeyInfo *xk_info = (XKeyInfo *) any_class;
|
|
|
b9a760 |
- ClutterInputDeviceX11 *device_x11;
|
|
|
b9a760 |
- guint n_keys;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- device_x11 = CLUTTER_INPUT_DEVICE_X11 (device);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- n_keys = xk_info->max_keycode - xk_info->min_keycode + 1;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- _clutter_input_device_set_n_keys (device, n_keys);
|
|
|
b9a760 |
- _clutter_input_device_x11_set_keycodes (device_x11,
|
|
|
b9a760 |
- xk_info->min_keycode,
|
|
|
b9a760 |
- xk_info->max_keycode);
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
- break;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- case ValuatorClass:
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- XValuatorInfo *xv_info = (XValuatorInfo *) any_class;
|
|
|
b9a760 |
- gint j;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- for (j = 0; j < xv_info->num_axes; j++)
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- ClutterInputAxis axis;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- switch (j)
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- case 0:
|
|
|
b9a760 |
- axis = CLUTTER_INPUT_AXIS_X;
|
|
|
b9a760 |
- break;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- case 1:
|
|
|
b9a760 |
- axis = CLUTTER_INPUT_AXIS_Y;
|
|
|
b9a760 |
- break;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- case 2:
|
|
|
b9a760 |
- axis = CLUTTER_INPUT_AXIS_PRESSURE;
|
|
|
b9a760 |
- break;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- case 3:
|
|
|
b9a760 |
- axis = CLUTTER_INPUT_AXIS_XTILT;
|
|
|
b9a760 |
- break;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- case 4:
|
|
|
b9a760 |
- axis = CLUTTER_INPUT_AXIS_YTILT;
|
|
|
b9a760 |
- break;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- case 5:
|
|
|
b9a760 |
- axis = CLUTTER_INPUT_AXIS_WHEEL;
|
|
|
b9a760 |
- break;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- default:
|
|
|
b9a760 |
- axis = CLUTTER_INPUT_AXIS_IGNORE;
|
|
|
b9a760 |
- break;
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- _clutter_input_device_add_axis (device, axis,
|
|
|
b9a760 |
- xv_info->axes[j].min_value,
|
|
|
b9a760 |
- xv_info->axes[j].max_value,
|
|
|
b9a760 |
- xv_info->axes[j].resolution);
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
- break;
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- any_class = (XAnyClassPtr) (((char *) any_class) + any_class->length);
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
-}
|
|
|
b9a760 |
-
|
|
|
b9a760 |
-static ClutterInputDevice *
|
|
|
b9a760 |
-create_device (ClutterDeviceManagerX11 *manager_x11,
|
|
|
b9a760 |
- ClutterBackendX11 *backend_x11,
|
|
|
b9a760 |
- XDeviceInfo *info)
|
|
|
b9a760 |
-{
|
|
|
b9a760 |
- ClutterInputDeviceType source;
|
|
|
b9a760 |
- ClutterInputDevice *retval;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- if (info->use != IsXExtensionPointer &&
|
|
|
b9a760 |
- info->use != IsXExtensionKeyboard)
|
|
|
b9a760 |
- return NULL;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- if (info->use == IsXExtensionKeyboard)
|
|
|
b9a760 |
- source = CLUTTER_KEYBOARD_DEVICE;
|
|
|
b9a760 |
- else
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- gchar *name;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- name = g_ascii_strdown (info->name, -1);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- if (strstr (name, "eraser") != NULL)
|
|
|
b9a760 |
- source = CLUTTER_ERASER_DEVICE;
|
|
|
b9a760 |
- else if (strstr (name, "cursor") != NULL)
|
|
|
b9a760 |
- source = CLUTTER_CURSOR_DEVICE;
|
|
|
b9a760 |
- else if (strstr (name, "wacom") != NULL || strstr (name, "pen") != NULL)
|
|
|
b9a760 |
- source = CLUTTER_PEN_DEVICE;
|
|
|
b9a760 |
- else
|
|
|
b9a760 |
- source = CLUTTER_POINTER_DEVICE;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- g_free (name);
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- retval = g_object_new (CLUTTER_TYPE_INPUT_DEVICE_X11,
|
|
|
b9a760 |
- "name", info->name,
|
|
|
b9a760 |
- "id", info->id,
|
|
|
b9a760 |
- "has-cursor", FALSE,
|
|
|
b9a760 |
- "device-manager", manager_x11,
|
|
|
b9a760 |
- "device-type", source,
|
|
|
b9a760 |
- "device-mode", CLUTTER_INPUT_MODE_FLOATING,
|
|
|
b9a760 |
- "backend", backend_x11,
|
|
|
b9a760 |
- "enabled", FALSE,
|
|
|
b9a760 |
- NULL);
|
|
|
b9a760 |
- translate_class_info (retval, info);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- CLUTTER_NOTE (BACKEND,
|
|
|
b9a760 |
- "XI Device '%s' (id: %d) created",
|
|
|
b9a760 |
- info->name,
|
|
|
b9a760 |
- (int) info->id);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- return retval;
|
|
|
b9a760 |
-}
|
|
|
b9a760 |
-#endif /* HAVE_XINPUT */
|
|
|
b9a760 |
-
|
|
|
b9a760 |
static inline void
|
|
|
b9a760 |
translate_key_event (ClutterBackendX11 *backend_x11,
|
|
|
b9a760 |
ClutterDeviceManagerX11 *manager_x11,
|
|
|
b9a760 |
@@ -275,20 +124,6 @@ out:
|
|
|
b9a760 |
return;
|
|
|
b9a760 |
}
|
|
|
b9a760 |
|
|
|
b9a760 |
-#ifdef HAVE_XINPUT
|
|
|
b9a760 |
-static ClutterInputDevice *
|
|
|
b9a760 |
-get_device_from_event (ClutterDeviceManagerX11 *manager_x11,
|
|
|
b9a760 |
- XEvent *xevent)
|
|
|
b9a760 |
-{
|
|
|
b9a760 |
- guint32 device_id;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- device_id = ((XDeviceButtonEvent *) xevent)->deviceid;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- return g_hash_table_lookup (manager_x11->devices_by_id,
|
|
|
b9a760 |
- GINT_TO_POINTER (device_id));
|
|
|
b9a760 |
-}
|
|
|
b9a760 |
-#endif /* HAVE_XINPUT */
|
|
|
b9a760 |
-
|
|
|
b9a760 |
static ClutterTranslateReturn
|
|
|
b9a760 |
clutter_device_manager_x11_translate_event (ClutterEventTranslator *translator,
|
|
|
b9a760 |
gpointer native,
|
|
|
b9a760 |
@@ -300,9 +135,6 @@ clutter_device_manager_x11_translate_event (ClutterEventTranslator *translator,
|
|
|
b9a760 |
ClutterTranslateReturn res;
|
|
|
b9a760 |
ClutterStage *stage;
|
|
|
b9a760 |
XEvent *xevent;
|
|
|
b9a760 |
-#ifdef HAVE_XINPUT
|
|
|
b9a760 |
- ClutterInputDevice *device;
|
|
|
b9a760 |
-#endif
|
|
|
b9a760 |
|
|
|
b9a760 |
manager_x11 = CLUTTER_DEVICE_MANAGER_X11 (translator);
|
|
|
b9a760 |
backend_x11 = CLUTTER_BACKEND_X11 (clutter_get_default_backend ());
|
|
|
b9a760 |
@@ -322,23 +154,6 @@ clutter_device_manager_x11_translate_event (ClutterEventTranslator *translator,
|
|
|
b9a760 |
|
|
|
b9a760 |
res = CLUTTER_TRANSLATE_CONTINUE;
|
|
|
b9a760 |
|
|
|
b9a760 |
-#ifdef HAVE_XINPUT
|
|
|
b9a760 |
- device = get_device_from_event (manager_x11, xevent);
|
|
|
b9a760 |
- if (device != NULL)
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- ClutterInputDeviceX11 *device_x11;
|
|
|
b9a760 |
- gboolean retval;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- device_x11 = CLUTTER_INPUT_DEVICE_X11 (device);
|
|
|
b9a760 |
- retval = _clutter_input_device_x11_translate_xi_event (device_x11,
|
|
|
b9a760 |
- stage_x11,
|
|
|
b9a760 |
- xevent,
|
|
|
b9a760 |
- event);
|
|
|
b9a760 |
- if (retval)
|
|
|
b9a760 |
- return CLUTTER_TRANSLATE_QUEUE;
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
-#endif /* HAVE_XINPUT */
|
|
|
b9a760 |
-
|
|
|
b9a760 |
switch (xevent->type)
|
|
|
b9a760 |
{
|
|
|
b9a760 |
case KeyPress:
|
|
|
b9a760 |
@@ -537,57 +352,12 @@ clutter_device_manager_x11_constructed (GObject *gobject)
|
|
|
b9a760 |
{
|
|
|
b9a760 |
ClutterDeviceManagerX11 *manager_x11;
|
|
|
b9a760 |
ClutterBackendX11 *backend_x11;
|
|
|
b9a760 |
-#ifdef HAVE_XINPUT
|
|
|
b9a760 |
- ClutterDeviceManager *manager;
|
|
|
b9a760 |
- XDeviceInfo *x_devices = NULL;
|
|
|
b9a760 |
- int i, n_devices;
|
|
|
b9a760 |
-#endif /* HAVE_XINPUT */
|
|
|
b9a760 |
|
|
|
b9a760 |
manager_x11 = CLUTTER_DEVICE_MANAGER_X11 (gobject);
|
|
|
b9a760 |
|
|
|
b9a760 |
g_object_get (gobject, "backend", &backend_x11, NULL);
|
|
|
b9a760 |
g_assert (backend_x11 != NULL);
|
|
|
b9a760 |
|
|
|
b9a760 |
-#ifdef HAVE_XINPUT
|
|
|
b9a760 |
- manager = CLUTTER_DEVICE_MANAGER (gobject);
|
|
|
b9a760 |
- x_devices = XListInputDevices (backend_x11->xdpy, &n_devices);
|
|
|
b9a760 |
- if (n_devices == 0)
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- CLUTTER_NOTE (BACKEND, "No XInput devices found");
|
|
|
b9a760 |
- goto default_device;
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- for (i = 0; i < n_devices; i++)
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- XDeviceInfo *info = x_devices + i;
|
|
|
b9a760 |
- ClutterInputDevice *device;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- CLUTTER_NOTE (BACKEND,
|
|
|
b9a760 |
- "Considering device %li with type %d, %d of %d",
|
|
|
b9a760 |
- info->id,
|
|
|
b9a760 |
- info->use,
|
|
|
b9a760 |
- i, n_devices);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- device = create_device (manager_x11, backend_x11, info);
|
|
|
b9a760 |
- if (device != NULL)
|
|
|
b9a760 |
- _clutter_device_manager_add_device (manager, device);
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- XFreeDeviceList (x_devices);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
-default_device:
|
|
|
b9a760 |
-#endif /* HAVE_XINPUT */
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- /* fallback code in case:
|
|
|
b9a760 |
- *
|
|
|
b9a760 |
- * - we do not have XInput support compiled in
|
|
|
b9a760 |
- * - we do not have the XInput extension
|
|
|
b9a760 |
- *
|
|
|
b9a760 |
- * we register two default devices, one for the pointer
|
|
|
b9a760 |
- * and one for the keyboard. this block must also be
|
|
|
b9a760 |
- * executed for the XInput support because XI does not
|
|
|
b9a760 |
- * cover core devices
|
|
|
b9a760 |
- */
|
|
|
b9a760 |
manager_x11->core_pointer =
|
|
|
b9a760 |
g_object_new (CLUTTER_TYPE_INPUT_DEVICE_X11,
|
|
|
b9a760 |
"name", "Core Pointer",
|
|
|
b9a760 |
diff --git a/clutter/x11/clutter-input-device-core-x11.c b/clutter/x11/clutter-input-device-core-x11.c
|
|
|
b9a760 |
index 6c78a30..0835c17 100644
|
|
|
b9a760 |
--- a/clutter/x11/clutter-input-device-core-x11.c
|
|
|
b9a760 |
+++ b/clutter/x11/clutter-input-device-core-x11.c
|
|
|
b9a760 |
@@ -33,12 +33,6 @@
|
|
|
b9a760 |
#include "clutter-backend-x11.h"
|
|
|
b9a760 |
#include "clutter-stage-x11.h"
|
|
|
b9a760 |
|
|
|
b9a760 |
-#ifdef HAVE_XINPUT
|
|
|
b9a760 |
-#include <X11/extensions/XInput.h>
|
|
|
b9a760 |
-#endif
|
|
|
b9a760 |
-
|
|
|
b9a760 |
-#define MAX_DEVICE_CLASSES 13
|
|
|
b9a760 |
-
|
|
|
b9a760 |
typedef struct _ClutterInputDeviceClass ClutterInputDeviceX11Class;
|
|
|
b9a760 |
|
|
|
b9a760 |
/* a specific X11 input device */
|
|
|
b9a760 |
@@ -46,22 +40,6 @@ struct _ClutterInputDeviceX11
|
|
|
b9a760 |
{
|
|
|
b9a760 |
ClutterInputDevice device;
|
|
|
b9a760 |
|
|
|
b9a760 |
-#ifdef HAVE_XINPUT
|
|
|
b9a760 |
- XDevice *xdevice;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- XEventClass event_classes[MAX_DEVICE_CLASSES];
|
|
|
b9a760 |
- int num_classes;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- int button_press_type;
|
|
|
b9a760 |
- int button_release_type;
|
|
|
b9a760 |
- int motion_notify_type;
|
|
|
b9a760 |
- int state_notify_type;
|
|
|
b9a760 |
- int key_press_type;
|
|
|
b9a760 |
- int key_release_type;
|
|
|
b9a760 |
-#endif /* HAVE_XINPUT */
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- gint *axis_data;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
int min_keycode;
|
|
|
b9a760 |
int max_keycode;
|
|
|
b9a760 |
};
|
|
|
b9a760 |
@@ -72,134 +50,6 @@ G_DEFINE_TYPE (ClutterInputDeviceX11,
|
|
|
b9a760 |
clutter_input_device_x11,
|
|
|
b9a760 |
CLUTTER_TYPE_INPUT_DEVICE);
|
|
|
b9a760 |
|
|
|
b9a760 |
-static void
|
|
|
b9a760 |
-clutter_input_device_x11_select_stage_events (ClutterInputDevice *device,
|
|
|
b9a760 |
- ClutterStage *stage,
|
|
|
b9a760 |
- gint event_mask)
|
|
|
b9a760 |
-{
|
|
|
b9a760 |
-#if HAVE_XINPUT
|
|
|
b9a760 |
- ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (device->backend);
|
|
|
b9a760 |
- ClutterInputDeviceX11 *device_x11;
|
|
|
b9a760 |
- ClutterStageX11 *stage_x11;
|
|
|
b9a760 |
- XEventClass class;
|
|
|
b9a760 |
- gint i;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- device_x11 = CLUTTER_INPUT_DEVICE_X11 (device);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- stage_x11 = CLUTTER_STAGE_X11 (_clutter_stage_get_window (stage));
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- i = 0;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- if (event_mask & ButtonPressMask)
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- DeviceButtonPress (device_x11->xdevice,
|
|
|
b9a760 |
- device_x11->button_press_type,
|
|
|
b9a760 |
- class);
|
|
|
b9a760 |
- if (class != 0)
|
|
|
b9a760 |
- device_x11->event_classes[i++] = class;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- DeviceButtonPressGrab (device_x11->xdevice, 0, class);
|
|
|
b9a760 |
- if (class != 0)
|
|
|
b9a760 |
- device_x11->event_classes[i++] = class;
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- if (event_mask & ButtonReleaseMask)
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- DeviceButtonRelease (device_x11->xdevice,
|
|
|
b9a760 |
- device_x11->button_release_type,
|
|
|
b9a760 |
- class);
|
|
|
b9a760 |
- if (class != 0)
|
|
|
b9a760 |
- device_x11->event_classes[i++] = class;
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- if (event_mask & PointerMotionMask)
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- DeviceMotionNotify (device_x11->xdevice,
|
|
|
b9a760 |
- device_x11->motion_notify_type,
|
|
|
b9a760 |
- class);
|
|
|
b9a760 |
- if (class != 0)
|
|
|
b9a760 |
- device_x11->event_classes[i++] = class;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- DeviceStateNotify (device_x11->xdevice,
|
|
|
b9a760 |
- device_x11->state_notify_type,
|
|
|
b9a760 |
- class);
|
|
|
b9a760 |
- if (class != 0)
|
|
|
b9a760 |
- device_x11->event_classes[i++] = class;
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- if (event_mask & KeyPressMask)
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- DeviceKeyPress (device_x11->xdevice,
|
|
|
b9a760 |
- device_x11->key_press_type,
|
|
|
b9a760 |
- class);
|
|
|
b9a760 |
- if (class != 0)
|
|
|
b9a760 |
- device_x11->event_classes[i++] = class;
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- if (event_mask & KeyReleaseMask)
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- DeviceKeyRelease (device_x11->xdevice,
|
|
|
b9a760 |
- device_x11->key_release_type,
|
|
|
b9a760 |
- class);
|
|
|
b9a760 |
- if (class != 0)
|
|
|
b9a760 |
- device_x11->event_classes[i++] = class;
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- device_x11->num_classes = i;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- XSelectExtensionEvent (backend_x11->xdpy,
|
|
|
b9a760 |
- stage_x11->xwin,
|
|
|
b9a760 |
- device_x11->event_classes,
|
|
|
b9a760 |
- device_x11->num_classes);
|
|
|
b9a760 |
-#endif /* HAVE_XINPUT */
|
|
|
b9a760 |
-}
|
|
|
b9a760 |
-
|
|
|
b9a760 |
-static void
|
|
|
b9a760 |
-clutter_input_device_x11_dispose (GObject *gobject)
|
|
|
b9a760 |
-{
|
|
|
b9a760 |
- ClutterInputDeviceX11 *device_x11 = CLUTTER_INPUT_DEVICE_X11 (gobject);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
-#ifdef HAVE_XINPUT
|
|
|
b9a760 |
- if (device_x11->xdevice)
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- ClutterInputDevice *device = CLUTTER_INPUT_DEVICE (gobject);
|
|
|
b9a760 |
- ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (device->backend);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- XCloseDevice (backend_x11->xdpy, device_x11->xdevice);
|
|
|
b9a760 |
- device_x11->xdevice = NULL;
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
-#endif /* HAVE_XINPUT */
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- g_free (device_x11->axis_data);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- G_OBJECT_CLASS (clutter_input_device_x11_parent_class)->dispose (gobject);
|
|
|
b9a760 |
-}
|
|
|
b9a760 |
-
|
|
|
b9a760 |
-static void
|
|
|
b9a760 |
-clutter_input_device_x11_constructed (GObject *gobject)
|
|
|
b9a760 |
-{
|
|
|
b9a760 |
-#ifdef HAVE_XINPUT
|
|
|
b9a760 |
- ClutterInputDeviceX11 *device_x11 = CLUTTER_INPUT_DEVICE_X11 (gobject);
|
|
|
b9a760 |
- ClutterInputDevice *device = CLUTTER_INPUT_DEVICE (gobject);
|
|
|
b9a760 |
- ClutterBackendX11 *backend_x11;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- backend_x11 = CLUTTER_BACKEND_X11 (device->backend);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- clutter_x11_trap_x_errors ();
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- device_x11->xdevice = XOpenDevice (backend_x11->xdpy, device->id);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- if (clutter_x11_untrap_x_errors ())
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- g_warning ("Device '%s' cannot be opened",
|
|
|
b9a760 |
- clutter_input_device_get_device_name (device));
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
-#endif /* HAVE_XINPUT */
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- if (G_OBJECT_CLASS (clutter_input_device_x11_parent_class)->constructed)
|
|
|
b9a760 |
- G_OBJECT_CLASS (clutter_input_device_x11_parent_class)->constructed (gobject);
|
|
|
b9a760 |
-}
|
|
|
b9a760 |
-
|
|
|
b9a760 |
static gboolean
|
|
|
b9a760 |
clutter_input_device_x11_keycode_to_evdev (ClutterInputDevice *device,
|
|
|
b9a760 |
guint hardware_keycode,
|
|
|
b9a760 |
@@ -220,10 +70,6 @@ clutter_input_device_x11_class_init (ClutterInputDeviceX11Class *klass)
|
|
|
b9a760 |
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
|
|
b9a760 |
ClutterInputDeviceClass *device_class = CLUTTER_INPUT_DEVICE_CLASS (klass);
|
|
|
b9a760 |
|
|
|
b9a760 |
- gobject_class->constructed = clutter_input_device_x11_constructed;
|
|
|
b9a760 |
- gobject_class->dispose = clutter_input_device_x11_dispose;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- device_class->select_stage_events = clutter_input_device_x11_select_stage_events;
|
|
|
b9a760 |
device_class->keycode_to_evdev = clutter_input_device_x11_keycode_to_evdev;
|
|
|
b9a760 |
}
|
|
|
b9a760 |
|
|
|
b9a760 |
@@ -252,222 +98,3 @@ _clutter_input_device_x11_get_max_keycode (ClutterInputDeviceX11 *device_x11)
|
|
|
b9a760 |
{
|
|
|
b9a760 |
return device_x11->max_keycode;
|
|
|
b9a760 |
}
|
|
|
b9a760 |
-
|
|
|
b9a760 |
-#ifdef HAVE_XINPUT
|
|
|
b9a760 |
-static void
|
|
|
b9a760 |
-update_axes (ClutterInputDeviceX11 *device_x11,
|
|
|
b9a760 |
- guint n_axes,
|
|
|
b9a760 |
- gint first_axis,
|
|
|
b9a760 |
- gint *axes_data)
|
|
|
b9a760 |
-{
|
|
|
b9a760 |
- ClutterInputDevice *device = CLUTTER_INPUT_DEVICE (device_x11);
|
|
|
b9a760 |
- gint i;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- if (device_x11->axis_data == NULL)
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- device_x11->axis_data =
|
|
|
b9a760 |
- g_new0 (gint, clutter_input_device_get_n_axes (device));
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- for (i = 0; i < n_axes; i++)
|
|
|
b9a760 |
- device_x11->axis_data[first_axis + i] = axes_data[i];
|
|
|
b9a760 |
-}
|
|
|
b9a760 |
-
|
|
|
b9a760 |
-static gdouble *
|
|
|
b9a760 |
-translate_axes (ClutterInputDeviceX11 *device_x11,
|
|
|
b9a760 |
- ClutterStageX11 *stage_x11,
|
|
|
b9a760 |
- gfloat *event_x,
|
|
|
b9a760 |
- gfloat *event_y)
|
|
|
b9a760 |
-{
|
|
|
b9a760 |
- ClutterInputDevice *device = CLUTTER_INPUT_DEVICE (device_x11);
|
|
|
b9a760 |
- gint root_x, root_y;
|
|
|
b9a760 |
- gint n_axes, i;
|
|
|
b9a760 |
- gdouble x, y;
|
|
|
b9a760 |
- gdouble *retval;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- if (!_clutter_stage_x11_get_root_coords (stage_x11, &root_x, &root_y))
|
|
|
b9a760 |
- return NULL;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- x = y = 0.0f;
|
|
|
b9a760 |
- n_axes = clutter_input_device_get_n_axes (device);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- retval = g_new0 (gdouble, n_axes);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- for (i = 0; i < n_axes; i++)
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- ClutterInputAxis axis;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- axis = clutter_input_device_get_axis (device, i);
|
|
|
b9a760 |
- switch (axis)
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- case CLUTTER_INPUT_AXIS_X:
|
|
|
b9a760 |
- case CLUTTER_INPUT_AXIS_Y:
|
|
|
b9a760 |
- _clutter_x11_input_device_translate_screen_coord (device,
|
|
|
b9a760 |
- root_x, root_y,
|
|
|
b9a760 |
- i,
|
|
|
b9a760 |
- device_x11->axis_data[i],
|
|
|
b9a760 |
- &retval[i]);
|
|
|
b9a760 |
- if (axis == CLUTTER_INPUT_AXIS_X)
|
|
|
b9a760 |
- x = retval[i];
|
|
|
b9a760 |
- else if (axis == CLUTTER_INPUT_AXIS_Y)
|
|
|
b9a760 |
- y = retval[i];
|
|
|
b9a760 |
- break;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- default:
|
|
|
b9a760 |
- _clutter_input_device_translate_axis (device, i,
|
|
|
b9a760 |
- device_x11->axis_data[i],
|
|
|
b9a760 |
- &retval[i]);
|
|
|
b9a760 |
- break;
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- if (event_x)
|
|
|
b9a760 |
- *event_x = x;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- if (event_y)
|
|
|
b9a760 |
- *event_y = y;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- return retval;
|
|
|
b9a760 |
-}
|
|
|
b9a760 |
-
|
|
|
b9a760 |
-/*
|
|
|
b9a760 |
- * translate_state:
|
|
|
b9a760 |
- * @state: the keyboard state of the core device
|
|
|
b9a760 |
- * @device_state: the button state of the device
|
|
|
b9a760 |
- *
|
|
|
b9a760 |
- * Trivially translates the state and the device state into a
|
|
|
b9a760 |
- * single bitmask.
|
|
|
b9a760 |
- */
|
|
|
b9a760 |
-static guint
|
|
|
b9a760 |
-translate_state (guint state,
|
|
|
b9a760 |
- guint device_state)
|
|
|
b9a760 |
-{
|
|
|
b9a760 |
- return device_state | (state & 0xff);
|
|
|
b9a760 |
-}
|
|
|
b9a760 |
-#endif /* HAVE_XINPUT */
|
|
|
b9a760 |
-
|
|
|
b9a760 |
-gboolean
|
|
|
b9a760 |
-_clutter_input_device_x11_translate_xi_event (ClutterInputDeviceX11 *device_x11,
|
|
|
b9a760 |
- ClutterStageX11 *stage_x11,
|
|
|
b9a760 |
- XEvent *xevent,
|
|
|
b9a760 |
- ClutterEvent *event)
|
|
|
b9a760 |
-{
|
|
|
b9a760 |
-#ifdef HAVE_XINPUT
|
|
|
b9a760 |
- ClutterInputDevice *device = CLUTTER_INPUT_DEVICE (device_x11);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- if ((xevent->type == device_x11->button_press_type) ||
|
|
|
b9a760 |
- (xevent->type == device_x11->button_release_type))
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- XDeviceButtonEvent *xdbe = (XDeviceButtonEvent *) xevent;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- event->button.type = event->type =
|
|
|
b9a760 |
- (xdbe->type == device_x11->button_press_type) ? CLUTTER_BUTTON_PRESS
|
|
|
b9a760 |
- : CLUTTER_BUTTON_RELEASE;
|
|
|
b9a760 |
- event->button.device = device;
|
|
|
b9a760 |
- event->button.time = xdbe->time;
|
|
|
b9a760 |
- event->button.button = xdbe->button;
|
|
|
b9a760 |
- event->button.modifier_state =
|
|
|
b9a760 |
- translate_state (xdbe->state, xdbe->device_state);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- update_axes (device_x11,
|
|
|
b9a760 |
- xdbe->axes_count,
|
|
|
b9a760 |
- xdbe->first_axis,
|
|
|
b9a760 |
- xdbe->axis_data);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- event->button.axes = translate_axes (device_x11, stage_x11,
|
|
|
b9a760 |
- &event->button.x,
|
|
|
b9a760 |
- &event->button.y);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- _clutter_stage_x11_set_user_time (stage_x11, event->button.time);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- return TRUE;
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- if ((xevent->type == device_x11->key_press_type) ||
|
|
|
b9a760 |
- (xevent->type == device_x11->key_release_type))
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- XDeviceKeyEvent *xdke = (XDeviceKeyEvent *) xevent;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- if (xdke->keycode < device_x11->min_keycode ||
|
|
|
b9a760 |
- xdke->keycode >= device_x11->max_keycode)
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- g_warning ("Invalid device key code received: %d", xdke->keycode);
|
|
|
b9a760 |
- return FALSE;
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- clutter_input_device_get_key (device,
|
|
|
b9a760 |
- xdke->keycode - device_x11->min_keycode,
|
|
|
b9a760 |
- &event->key.keyval,
|
|
|
b9a760 |
- &event->key.modifier_state);
|
|
|
b9a760 |
- if (event->key.keyval == 0)
|
|
|
b9a760 |
- return FALSE;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- event->key.type = event->type =
|
|
|
b9a760 |
- (xdke->type == device_x11->key_press_type) ? CLUTTER_KEY_PRESS
|
|
|
b9a760 |
- : CLUTTER_KEY_RELEASE;
|
|
|
b9a760 |
- event->key.time = xdke->time;
|
|
|
b9a760 |
- event->key.modifier_state |=
|
|
|
b9a760 |
- translate_state (xdke->state, xdke->device_state);
|
|
|
b9a760 |
- event->key.device = device;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
-#if 0
|
|
|
b9a760 |
- if ((event->key.keyval >= 0x20) && (event->key.keyval <= 0xff))
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- event->key.unicode = (gunichar) event->key.keyval;
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
-#endif
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- _clutter_stage_x11_set_user_time (stage_x11, event->key.time);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- return TRUE;
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- if (xevent->type == device_x11->motion_notify_type)
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- XDeviceMotionEvent *xdme = (XDeviceMotionEvent *) xevent;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- event->motion.type = event->type = CLUTTER_MOTION;
|
|
|
b9a760 |
- event->motion.time = xdme->time;
|
|
|
b9a760 |
- event->motion.modifier_state =
|
|
|
b9a760 |
- translate_state (xdme->state, xdme->device_state);
|
|
|
b9a760 |
- event->motion.device = device;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- event->motion.axes =
|
|
|
b9a760 |
- g_new0 (gdouble, clutter_input_device_get_n_axes (device));
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- update_axes (device_x11,
|
|
|
b9a760 |
- xdme->axes_count,
|
|
|
b9a760 |
- xdme->first_axis,
|
|
|
b9a760 |
- xdme->axis_data);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- event->motion.axes = translate_axes (device_x11, stage_x11,
|
|
|
b9a760 |
- &event->motion.x,
|
|
|
b9a760 |
- &event->motion.y);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- return TRUE;
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- if (xevent->type == device_x11->state_notify_type)
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- XDeviceStateNotifyEvent *xdse = (XDeviceStateNotifyEvent *) xevent;
|
|
|
b9a760 |
- XInputClass *input_class = (XInputClass *) xdse->data;
|
|
|
b9a760 |
- gint n_axes = clutter_input_device_get_n_axes (device);
|
|
|
b9a760 |
- int i;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- for (i = 0; i < xdse->num_classes; i++)
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- if (input_class->class == ValuatorClass)
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- int *axis_data = ((XValuatorState *) input_class)->valuators;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- update_axes (device_x11, n_axes, 0, axis_data);
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- input_class =
|
|
|
b9a760 |
- (XInputClass *)(((char *) input_class) + input_class->length);
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
-#endif /* HAVE_XINPUT */
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- return FALSE;
|
|
|
b9a760 |
-}
|
|
|
b9a760 |
diff --git a/clutter/x11/clutter-input-device-core-x11.h b/clutter/x11/clutter-input-device-core-x11.h
|
|
|
b9a760 |
index af4ed59..ce6b125 100644
|
|
|
b9a760 |
--- a/clutter/x11/clutter-input-device-core-x11.h
|
|
|
b9a760 |
+++ b/clutter/x11/clutter-input-device-core-x11.h
|
|
|
b9a760 |
@@ -45,11 +45,6 @@ void _clutter_input_device_x11_set_keycodes (ClutterInputDeviceX11 *device_x11,
|
|
|
b9a760 |
int _clutter_input_device_x11_get_min_keycode (ClutterInputDeviceX11 *device_x11);
|
|
|
b9a760 |
int _clutter_input_device_x11_get_max_keycode (ClutterInputDeviceX11 *device_x11);
|
|
|
b9a760 |
|
|
|
b9a760 |
-gboolean _clutter_input_device_x11_translate_xi_event (ClutterInputDeviceX11 *device_x11,
|
|
|
b9a760 |
- ClutterStageX11 *stage_x11,
|
|
|
b9a760 |
- XEvent *xevent,
|
|
|
b9a760 |
- ClutterEvent *event);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
G_END_DECLS
|
|
|
b9a760 |
|
|
|
b9a760 |
#endif /* __CLUTTER_INPUT_DEVICE_X11_H__ */
|
|
|
b9a760 |
diff --git a/configure.ac b/configure.ac
|
|
|
b9a760 |
index 8dcbf58..47c32d2 100644
|
|
|
b9a760 |
--- a/configure.ac
|
|
|
b9a760 |
+++ b/configure.ac
|
|
|
b9a760 |
@@ -717,12 +717,6 @@ AS_IF([test "x$SUPPORT_X11" = "x1"],
|
|
|
b9a760 |
AC_DEFINE([HAVE_XINPUT_2],
|
|
|
b9a760 |
[1],
|
|
|
b9a760 |
[Define to 1 if XI2 is available])
|
|
|
b9a760 |
- ],
|
|
|
b9a760 |
- [
|
|
|
b9a760 |
- have_xinput2=no
|
|
|
b9a760 |
- AC_DEFINE([HAVE_XINPUT],
|
|
|
b9a760 |
- [1],
|
|
|
b9a760 |
- [Define to 1 if XInput is available])
|
|
|
b9a760 |
])
|
|
|
b9a760 |
|
|
|
b9a760 |
clutter_save_LIBS="$LIBS"
|
|
|
b9a760 |
--
|
|
|
b9a760 |
1.8.4.2
|
|
|
b9a760 |
|
|
|
b9a760 |
|
|
|
b9a760 |
From 97584c62c11057944645fb6efab53bdee16ee20e Mon Sep 17 00:00:00 2001
|
|
|
b9a760 |
From: "Jasper St. Pierre" <jstpierre@mecheye.net>
|
|
|
b9a760 |
Date: Wed, 10 Jul 2013 16:34:48 -0400
|
|
|
b9a760 |
Subject: [PATCH 3/4] device-manager: Don't pass the event mask around
|
|
|
b9a760 |
|
|
|
b9a760 |
There's no point in doing this, as we always use a constant event mask.
|
|
|
b9a760 |
Simply do what everything else does.
|
|
|
b9a760 |
|
|
|
b9a760 |
https://bugzilla.gnome.org/show_bug.cgi?id=703969
|
|
|
b9a760 |
---
|
|
|
b9a760 |
clutter/clutter-device-manager-private.h | 9 +++------
|
|
|
b9a760 |
clutter/clutter-device-manager.c | 5 ++---
|
|
|
b9a760 |
clutter/clutter-input-device.c | 6 ++----
|
|
|
b9a760 |
clutter/x11/clutter-input-device-xi2.c | 30 ++++++++----------------------
|
|
|
b9a760 |
clutter/x11/clutter-stage-x11.c | 26 +++++---------------------
|
|
|
b9a760 |
clutter/x11/clutter-stage-x11.h | 2 +-
|
|
|
b9a760 |
6 files changed, 21 insertions(+), 57 deletions(-)
|
|
|
b9a760 |
|
|
|
b9a760 |
diff --git a/clutter/clutter-device-manager-private.h b/clutter/clutter-device-manager-private.h
|
|
|
b9a760 |
index 8bc5330..631a776 100644
|
|
|
b9a760 |
--- a/clutter/clutter-device-manager-private.h
|
|
|
b9a760 |
+++ b/clutter/clutter-device-manager-private.h
|
|
|
b9a760 |
@@ -138,8 +138,7 @@ struct _ClutterInputDeviceClass
|
|
|
b9a760 |
GObjectClass parent_class;
|
|
|
b9a760 |
|
|
|
b9a760 |
void (* select_stage_events) (ClutterInputDevice *device,
|
|
|
b9a760 |
- ClutterStage *stage,
|
|
|
b9a760 |
- gint event_mask);
|
|
|
b9a760 |
+ ClutterStage *stage);
|
|
|
b9a760 |
gboolean (* keycode_to_evdev) (ClutterInputDevice *device,
|
|
|
b9a760 |
guint hardware_keycode,
|
|
|
b9a760 |
guint *evdev_keycode);
|
|
|
b9a760 |
@@ -152,8 +151,7 @@ void _clutter_device_manager_remove_device (ClutterDeviceMa
|
|
|
b9a760 |
ClutterInputDevice *device);
|
|
|
b9a760 |
void _clutter_device_manager_update_devices (ClutterDeviceManager *device_manager);
|
|
|
b9a760 |
void _clutter_device_manager_select_stage_events (ClutterDeviceManager *device_manager,
|
|
|
b9a760 |
- ClutterStage *stage,
|
|
|
b9a760 |
- gint event_mask);
|
|
|
b9a760 |
+ ClutterStage *stage);
|
|
|
b9a760 |
ClutterBackend *_clutter_device_manager_get_backend (ClutterDeviceManager *device_manager);
|
|
|
b9a760 |
|
|
|
b9a760 |
/* input device */
|
|
|
b9a760 |
@@ -199,8 +197,7 @@ void _clutter_input_device_remove_slave (ClutterInputDev
|
|
|
b9a760 |
ClutterInputDevice *slave);
|
|
|
b9a760 |
|
|
|
b9a760 |
void _clutter_input_device_select_stage_events (ClutterInputDevice *device,
|
|
|
b9a760 |
- ClutterStage *stage,
|
|
|
b9a760 |
- gint event_flags);
|
|
|
b9a760 |
+ ClutterStage *stage);
|
|
|
b9a760 |
|
|
|
b9a760 |
gboolean _clutter_input_device_translate_axis (ClutterInputDevice *device,
|
|
|
b9a760 |
guint index_,
|
|
|
b9a760 |
diff --git a/clutter/clutter-device-manager.c b/clutter/clutter-device-manager.c
|
|
|
b9a760 |
index 2dc67be..c54b3e0 100644
|
|
|
b9a760 |
--- a/clutter/clutter-device-manager.c
|
|
|
b9a760 |
+++ b/clutter/clutter-device-manager.c
|
|
|
b9a760 |
@@ -308,8 +308,7 @@ clutter_device_manager_get_core_device (ClutterDeviceManager *device_manager,
|
|
|
b9a760 |
|
|
|
b9a760 |
void
|
|
|
b9a760 |
_clutter_device_manager_select_stage_events (ClutterDeviceManager *device_manager,
|
|
|
b9a760 |
- ClutterStage *stage,
|
|
|
b9a760 |
- gint event_flags)
|
|
|
b9a760 |
+ ClutterStage *stage)
|
|
|
b9a760 |
{
|
|
|
b9a760 |
ClutterDeviceManagerClass *manager_class;
|
|
|
b9a760 |
const GSList *devices, *d;
|
|
|
b9a760 |
@@ -324,7 +323,7 @@ _clutter_device_manager_select_stage_events (ClutterDeviceManager *device_manage
|
|
|
b9a760 |
ClutterInputDevice *device = d->data;
|
|
|
b9a760 |
|
|
|
b9a760 |
if (device->is_enabled)
|
|
|
b9a760 |
- _clutter_input_device_select_stage_events (device, stage, event_flags);
|
|
|
b9a760 |
+ _clutter_input_device_select_stage_events (device, stage);
|
|
|
b9a760 |
}
|
|
|
b9a760 |
}
|
|
|
b9a760 |
|
|
|
b9a760 |
diff --git a/clutter/clutter-input-device.c b/clutter/clutter-input-device.c
|
|
|
b9a760 |
index d222177..48cb40a 100644
|
|
|
b9a760 |
--- a/clutter/clutter-input-device.c
|
|
|
b9a760 |
+++ b/clutter/clutter-input-device.c
|
|
|
b9a760 |
@@ -1624,7 +1624,6 @@ clutter_input_device_get_associated_device (ClutterInputDevice *device)
|
|
|
b9a760 |
* clutter_input_device_select_stage_events:
|
|
|
b9a760 |
* @device: a #ClutterInputDevice
|
|
|
b9a760 |
* @stage: the #ClutterStage to select events on
|
|
|
b9a760 |
- * @event_mask: platform-specific mask of events
|
|
|
b9a760 |
*
|
|
|
b9a760 |
* Selects input device events on @stage.
|
|
|
b9a760 |
*
|
|
|
b9a760 |
@@ -1632,14 +1631,13 @@ clutter_input_device_get_associated_device (ClutterInputDevice *device)
|
|
|
b9a760 |
*/
|
|
|
b9a760 |
void
|
|
|
b9a760 |
_clutter_input_device_select_stage_events (ClutterInputDevice *device,
|
|
|
b9a760 |
- ClutterStage *stage,
|
|
|
b9a760 |
- gint event_mask)
|
|
|
b9a760 |
+ ClutterStage *stage)
|
|
|
b9a760 |
{
|
|
|
b9a760 |
ClutterInputDeviceClass *device_class;
|
|
|
b9a760 |
|
|
|
b9a760 |
device_class = CLUTTER_INPUT_DEVICE_GET_CLASS (device);
|
|
|
b9a760 |
if (device_class->select_stage_events != NULL)
|
|
|
b9a760 |
- device_class->select_stage_events (device, stage, event_mask);
|
|
|
b9a760 |
+ device_class->select_stage_events (device, stage);
|
|
|
b9a760 |
}
|
|
|
b9a760 |
|
|
|
b9a760 |
/**
|
|
|
b9a760 |
diff --git a/clutter/x11/clutter-input-device-xi2.c b/clutter/x11/clutter-input-device-xi2.c
|
|
|
b9a760 |
index 5923977..cd65b7b 100644
|
|
|
b9a760 |
--- a/clutter/x11/clutter-input-device-xi2.c
|
|
|
b9a760 |
+++ b/clutter/x11/clutter-input-device-xi2.c
|
|
|
b9a760 |
@@ -55,8 +55,7 @@ G_DEFINE_TYPE (ClutterInputDeviceXI2,
|
|
|
b9a760 |
|
|
|
b9a760 |
static void
|
|
|
b9a760 |
clutter_input_device_xi2_select_stage_events (ClutterInputDevice *device,
|
|
|
b9a760 |
- ClutterStage *stage,
|
|
|
b9a760 |
- gint event_mask)
|
|
|
b9a760 |
+ ClutterStage *stage)
|
|
|
b9a760 |
{
|
|
|
b9a760 |
ClutterInputDeviceXI2 *device_xi2 = CLUTTER_INPUT_DEVICE_XI2 (device);
|
|
|
b9a760 |
ClutterBackendX11 *backend_x11;
|
|
|
b9a760 |
@@ -71,26 +70,13 @@ clutter_input_device_xi2_select_stage_events (ClutterInputDevice *device,
|
|
|
b9a760 |
len = XIMaskLen (XI_LASTEVENT);
|
|
|
b9a760 |
mask = g_new0 (unsigned char, len);
|
|
|
b9a760 |
|
|
|
b9a760 |
- if (event_mask & PointerMotionMask)
|
|
|
b9a760 |
- XISetMask (mask, XI_Motion);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- if (event_mask & ButtonPressMask)
|
|
|
b9a760 |
- XISetMask (mask, XI_ButtonPress);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- if (event_mask & ButtonReleaseMask)
|
|
|
b9a760 |
- XISetMask (mask, XI_ButtonRelease);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- if (event_mask & KeyPressMask)
|
|
|
b9a760 |
- XISetMask (mask, XI_KeyPress);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- if (event_mask & KeyReleaseMask)
|
|
|
b9a760 |
- XISetMask (mask, XI_KeyRelease);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- if (event_mask & EnterWindowMask)
|
|
|
b9a760 |
- XISetMask (mask, XI_Enter);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- if (event_mask & LeaveWindowMask)
|
|
|
b9a760 |
- XISetMask (mask, XI_Leave);
|
|
|
b9a760 |
+ XISetMask (mask, XI_Motion);
|
|
|
b9a760 |
+ XISetMask (mask, XI_ButtonPress);
|
|
|
b9a760 |
+ XISetMask (mask, XI_ButtonRelease);
|
|
|
b9a760 |
+ XISetMask (mask, XI_KeyPress);
|
|
|
b9a760 |
+ XISetMask (mask, XI_KeyRelease);
|
|
|
b9a760 |
+ XISetMask (mask, XI_Enter);
|
|
|
b9a760 |
+ XISetMask (mask, XI_Leave);
|
|
|
b9a760 |
|
|
|
b9a760 |
#ifdef HAVE_XINPUT_2_2
|
|
|
b9a760 |
/* enable touch event support if we're running on XInput 2.2 */
|
|
|
b9a760 |
diff --git a/clutter/x11/clutter-stage-x11.c b/clutter/x11/clutter-stage-x11.c
|
|
|
b9a760 |
index 230172c..08b8e15 100644
|
|
|
b9a760 |
--- a/clutter/x11/clutter-stage-x11.c
|
|
|
b9a760 |
+++ b/clutter/x11/clutter-stage-x11.c
|
|
|
b9a760 |
@@ -547,14 +547,10 @@ _clutter_stage_x11_events_device_changed (ClutterStageX11 *stage_x11,
|
|
|
b9a760 |
ClutterDeviceManager *device_manager)
|
|
|
b9a760 |
{
|
|
|
b9a760 |
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11);
|
|
|
b9a760 |
- int event_flags = 0;
|
|
|
b9a760 |
|
|
|
b9a760 |
if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_FLOATING)
|
|
|
b9a760 |
- event_flags = CLUTTER_STAGE_X11_EVENT_MASK;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- _clutter_device_manager_select_stage_events (device_manager,
|
|
|
b9a760 |
- stage_cogl->wrapper,
|
|
|
b9a760 |
- event_flags);
|
|
|
b9a760 |
+ _clutter_device_manager_select_stage_events (device_manager,
|
|
|
b9a760 |
+ stage_cogl->wrapper);
|
|
|
b9a760 |
}
|
|
|
b9a760 |
|
|
|
b9a760 |
static void
|
|
|
b9a760 |
@@ -564,12 +560,10 @@ stage_events_device_added (ClutterDeviceManager *device_manager,
|
|
|
b9a760 |
{
|
|
|
b9a760 |
ClutterStageWindow *stage_window = user_data;
|
|
|
b9a760 |
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
|
|
|
b9a760 |
- int event_flags = CLUTTER_STAGE_X11_EVENT_MASK;
|
|
|
b9a760 |
|
|
|
b9a760 |
if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_FLOATING)
|
|
|
b9a760 |
_clutter_device_manager_select_stage_events (device_manager,
|
|
|
b9a760 |
- stage_cogl->wrapper,
|
|
|
b9a760 |
- event_flags);
|
|
|
b9a760 |
+ stage_cogl->wrapper);
|
|
|
b9a760 |
}
|
|
|
b9a760 |
|
|
|
b9a760 |
static gboolean
|
|
|
b9a760 |
@@ -580,7 +574,6 @@ clutter_stage_x11_realize (ClutterStageWindow *stage_window)
|
|
|
b9a760 |
ClutterBackend *backend = CLUTTER_BACKEND (stage_cogl->backend);
|
|
|
b9a760 |
ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (backend);
|
|
|
b9a760 |
ClutterDeviceManager *device_manager;
|
|
|
b9a760 |
- int event_flags;
|
|
|
b9a760 |
gfloat width, height;
|
|
|
b9a760 |
|
|
|
b9a760 |
clutter_actor_get_size (CLUTTER_ACTOR (stage_cogl->wrapper),
|
|
|
b9a760 |
@@ -623,14 +616,6 @@ clutter_stage_x11_realize (ClutterStageWindow *stage_window)
|
|
|
b9a760 |
set_wm_title (stage_x11);
|
|
|
b9a760 |
set_cursor_visible (stage_x11);
|
|
|
b9a760 |
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- /* the masks for the events we want to select on a stage window;
|
|
|
b9a760 |
- * KeyPressMask and KeyReleaseMask are necessary even with XI1
|
|
|
b9a760 |
- * because key events are broken with that extension, and will
|
|
|
b9a760 |
- * be fixed by XI2
|
|
|
b9a760 |
- */
|
|
|
b9a760 |
- event_flags = CLUTTER_STAGE_X11_EVENT_MASK;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
/* we unconditionally select input events even with event retrieval
|
|
|
b9a760 |
* disabled because we need to guarantee that the Clutter internal
|
|
|
b9a760 |
* state is maintained when calling clutter_x11_handle_event() without
|
|
|
b9a760 |
@@ -648,7 +633,7 @@ clutter_stage_x11_realize (ClutterStageWindow *stage_window)
|
|
|
b9a760 |
* for an example of things that break if we do conditional event
|
|
|
b9a760 |
* selection.
|
|
|
b9a760 |
*/
|
|
|
b9a760 |
- XSelectInput (backend_x11->xdpy, stage_x11->xwin, event_flags);
|
|
|
b9a760 |
+ XSelectInput (backend_x11->xdpy, stage_x11->xwin, CLUTTER_STAGE_X11_EVENT_MASK);
|
|
|
b9a760 |
|
|
|
b9a760 |
/* input events also depent on the actual device, so we need to
|
|
|
b9a760 |
* use the device manager to let every device select them, using
|
|
|
b9a760 |
@@ -658,8 +643,7 @@ clutter_stage_x11_realize (ClutterStageWindow *stage_window)
|
|
|
b9a760 |
if (G_UNLIKELY (device_manager != NULL))
|
|
|
b9a760 |
{
|
|
|
b9a760 |
_clutter_device_manager_select_stage_events (device_manager,
|
|
|
b9a760 |
- stage_cogl->wrapper,
|
|
|
b9a760 |
- event_flags);
|
|
|
b9a760 |
+ stage_cogl->wrapper);
|
|
|
b9a760 |
|
|
|
b9a760 |
g_signal_connect (device_manager, "device-added",
|
|
|
b9a760 |
G_CALLBACK (stage_events_device_added),
|
|
|
b9a760 |
diff --git a/clutter/x11/clutter-stage-x11.h b/clutter/x11/clutter-stage-x11.h
|
|
|
b9a760 |
index c7a7a1b..8b61056 100644
|
|
|
b9a760 |
--- a/clutter/x11/clutter-stage-x11.h
|
|
|
b9a760 |
+++ b/clutter/x11/clutter-stage-x11.h
|
|
|
b9a760 |
@@ -86,7 +86,7 @@ struct _ClutterStageX11Class
|
|
|
b9a760 |
KeyReleaseMask | \
|
|
|
b9a760 |
ButtonPressMask | \
|
|
|
b9a760 |
ButtonReleaseMask | \
|
|
|
b9a760 |
- PointerMotionMask;
|
|
|
b9a760 |
+ PointerMotionMask
|
|
|
b9a760 |
|
|
|
b9a760 |
GType _clutter_stage_x11_get_type (void) G_GNUC_CONST;
|
|
|
b9a760 |
|
|
|
b9a760 |
--
|
|
|
b9a760 |
1.8.4.2
|
|
|
b9a760 |
|
|
|
b9a760 |
|
|
|
b9a760 |
From 95eb3eb5759644d671fab54142f1a43c3cd1c48e Mon Sep 17 00:00:00 2001
|
|
|
b9a760 |
From: "Jasper St. Pierre" <jstpierre@mecheye.net>
|
|
|
b9a760 |
Date: Wed, 10 Jul 2013 16:53:26 -0400
|
|
|
b9a760 |
Subject: [PATCH 4/4] device-manager: Select for events on XIAllMasterDevices
|
|
|
b9a760 |
|
|
|
b9a760 |
This removes a bit of work that we have to do for every device, and makes it
|
|
|
b9a760 |
easy for mutter to patch out parts of the event mask it doesn't want.
|
|
|
b9a760 |
|
|
|
b9a760 |
https://bugzilla.gnome.org/show_bug.cgi?id=703969
|
|
|
b9a760 |
---
|
|
|
b9a760 |
clutter/clutter-device-manager-private.h | 5 ----
|
|
|
b9a760 |
clutter/clutter-device-manager.c | 12 ++------
|
|
|
b9a760 |
clutter/clutter-device-manager.h | 4 ++-
|
|
|
b9a760 |
clutter/clutter-input-device.c | 20 -------------
|
|
|
b9a760 |
clutter/x11/clutter-device-manager-xi2.c | 44 +++++++++++++++++++++++++++++
|
|
|
b9a760 |
clutter/x11/clutter-input-device-xi2.c | 48 --------------------------------
|
|
|
b9a760 |
6 files changed, 49 insertions(+), 84 deletions(-)
|
|
|
b9a760 |
|
|
|
b9a760 |
diff --git a/clutter/clutter-device-manager-private.h b/clutter/clutter-device-manager-private.h
|
|
|
b9a760 |
index 631a776..826b2f6 100644
|
|
|
b9a760 |
--- a/clutter/clutter-device-manager-private.h
|
|
|
b9a760 |
+++ b/clutter/clutter-device-manager-private.h
|
|
|
b9a760 |
@@ -137,8 +137,6 @@ struct _ClutterInputDeviceClass
|
|
|
b9a760 |
{
|
|
|
b9a760 |
GObjectClass parent_class;
|
|
|
b9a760 |
|
|
|
b9a760 |
- void (* select_stage_events) (ClutterInputDevice *device,
|
|
|
b9a760 |
- ClutterStage *stage);
|
|
|
b9a760 |
gboolean (* keycode_to_evdev) (ClutterInputDevice *device,
|
|
|
b9a760 |
guint hardware_keycode,
|
|
|
b9a760 |
guint *evdev_keycode);
|
|
|
b9a760 |
@@ -196,9 +194,6 @@ void _clutter_input_device_add_slave (ClutterInputDev
|
|
|
b9a760 |
void _clutter_input_device_remove_slave (ClutterInputDevice *master,
|
|
|
b9a760 |
ClutterInputDevice *slave);
|
|
|
b9a760 |
|
|
|
b9a760 |
-void _clutter_input_device_select_stage_events (ClutterInputDevice *device,
|
|
|
b9a760 |
- ClutterStage *stage);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
gboolean _clutter_input_device_translate_axis (ClutterInputDevice *device,
|
|
|
b9a760 |
guint index_,
|
|
|
b9a760 |
gdouble value,
|
|
|
b9a760 |
diff --git a/clutter/clutter-device-manager.c b/clutter/clutter-device-manager.c
|
|
|
b9a760 |
index c54b3e0..fde30ea 100644
|
|
|
b9a760 |
--- a/clutter/clutter-device-manager.c
|
|
|
b9a760 |
+++ b/clutter/clutter-device-manager.c
|
|
|
b9a760 |
@@ -311,20 +311,12 @@ _clutter_device_manager_select_stage_events (ClutterDeviceManager *device_manage
|
|
|
b9a760 |
ClutterStage *stage)
|
|
|
b9a760 |
{
|
|
|
b9a760 |
ClutterDeviceManagerClass *manager_class;
|
|
|
b9a760 |
- const GSList *devices, *d;
|
|
|
b9a760 |
|
|
|
b9a760 |
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
|
|
b9a760 |
|
|
|
b9a760 |
manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
|
|
|
b9a760 |
- devices = manager_class->get_devices (device_manager);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- for (d = devices; d != NULL; d = d->next)
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- ClutterInputDevice *device = d->data;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- if (device->is_enabled)
|
|
|
b9a760 |
- _clutter_input_device_select_stage_events (device, stage);
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
+ if (manager_class->select_stage_events)
|
|
|
b9a760 |
+ manager_class->select_stage_events (device_manager, stage);
|
|
|
b9a760 |
}
|
|
|
b9a760 |
|
|
|
b9a760 |
/*
|
|
|
b9a760 |
diff --git a/clutter/clutter-device-manager.h b/clutter/clutter-device-manager.h
|
|
|
b9a760 |
index 94cde3d..49b0f94 100644
|
|
|
b9a760 |
--- a/clutter/clutter-device-manager.h
|
|
|
b9a760 |
+++ b/clutter/clutter-device-manager.h
|
|
|
b9a760 |
@@ -81,9 +81,11 @@ struct _ClutterDeviceManagerClass
|
|
|
b9a760 |
ClutterInputDevice *device);
|
|
|
b9a760 |
void (* remove_device) (ClutterDeviceManager *manager,
|
|
|
b9a760 |
ClutterInputDevice *device);
|
|
|
b9a760 |
+ void (* select_stage_events) (ClutterDeviceManager *manager,
|
|
|
b9a760 |
+ ClutterStage *stage);
|
|
|
b9a760 |
|
|
|
b9a760 |
/* padding */
|
|
|
b9a760 |
- gpointer _padding[8];
|
|
|
b9a760 |
+ gpointer _padding[7];
|
|
|
b9a760 |
};
|
|
|
b9a760 |
|
|
|
b9a760 |
|
|
|
b9a760 |
diff --git a/clutter/clutter-input-device.c b/clutter/clutter-input-device.c
|
|
|
b9a760 |
index 48cb40a..6aed92b 100644
|
|
|
b9a760 |
--- a/clutter/clutter-input-device.c
|
|
|
b9a760 |
+++ b/clutter/clutter-input-device.c
|
|
|
b9a760 |
@@ -1620,26 +1620,6 @@ clutter_input_device_get_associated_device (ClutterInputDevice *device)
|
|
|
b9a760 |
return device->associated;
|
|
|
b9a760 |
}
|
|
|
b9a760 |
|
|
|
b9a760 |
-/*< internal >
|
|
|
b9a760 |
- * clutter_input_device_select_stage_events:
|
|
|
b9a760 |
- * @device: a #ClutterInputDevice
|
|
|
b9a760 |
- * @stage: the #ClutterStage to select events on
|
|
|
b9a760 |
- *
|
|
|
b9a760 |
- * Selects input device events on @stage.
|
|
|
b9a760 |
- *
|
|
|
b9a760 |
- * The implementation of this function depends on the backend used.
|
|
|
b9a760 |
- */
|
|
|
b9a760 |
-void
|
|
|
b9a760 |
-_clutter_input_device_select_stage_events (ClutterInputDevice *device,
|
|
|
b9a760 |
- ClutterStage *stage)
|
|
|
b9a760 |
-{
|
|
|
b9a760 |
- ClutterInputDeviceClass *device_class;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- device_class = CLUTTER_INPUT_DEVICE_GET_CLASS (device);
|
|
|
b9a760 |
- if (device_class->select_stage_events != NULL)
|
|
|
b9a760 |
- device_class->select_stage_events (device, stage);
|
|
|
b9a760 |
-}
|
|
|
b9a760 |
-
|
|
|
b9a760 |
/**
|
|
|
b9a760 |
* clutter_input_device_keycode_to_evdev:
|
|
|
b9a760 |
* @device: A #ClutterInputDevice
|
|
|
b9a760 |
diff --git a/clutter/x11/clutter-device-manager-xi2.c b/clutter/x11/clutter-device-manager-xi2.c
|
|
|
b9a760 |
index 49ee212..e5664d8 100644
|
|
|
b9a760 |
--- a/clutter/x11/clutter-device-manager-xi2.c
|
|
|
b9a760 |
+++ b/clutter/x11/clutter-device-manager-xi2.c
|
|
|
b9a760 |
@@ -688,6 +688,49 @@ scroll_valuators_changed (ClutterInputDevice *device,
|
|
|
b9a760 |
return retval;
|
|
|
b9a760 |
}
|
|
|
b9a760 |
|
|
|
b9a760 |
+static void
|
|
|
b9a760 |
+clutter_device_manager_xi2_select_stage_events (ClutterDeviceManager *manager,
|
|
|
b9a760 |
+ ClutterStage *stage)
|
|
|
b9a760 |
+{
|
|
|
b9a760 |
+ ClutterBackendX11 *backend_x11;
|
|
|
b9a760 |
+ ClutterStageX11 *stage_x11;
|
|
|
b9a760 |
+ XIEventMask xi_event_mask;
|
|
|
b9a760 |
+ unsigned char *mask;
|
|
|
b9a760 |
+ int len;
|
|
|
b9a760 |
+
|
|
|
b9a760 |
+ backend_x11 = CLUTTER_BACKEND_X11 (clutter_get_default_backend ());
|
|
|
b9a760 |
+ stage_x11 = CLUTTER_STAGE_X11 (_clutter_stage_get_window (stage));
|
|
|
b9a760 |
+
|
|
|
b9a760 |
+ len = XIMaskLen (XI_LASTEVENT);
|
|
|
b9a760 |
+ mask = g_new0 (unsigned char, len);
|
|
|
b9a760 |
+
|
|
|
b9a760 |
+ XISetMask (mask, XI_Motion);
|
|
|
b9a760 |
+ XISetMask (mask, XI_ButtonPress);
|
|
|
b9a760 |
+ XISetMask (mask, XI_ButtonRelease);
|
|
|
b9a760 |
+ XISetMask (mask, XI_KeyPress);
|
|
|
b9a760 |
+ XISetMask (mask, XI_KeyRelease);
|
|
|
b9a760 |
+ XISetMask (mask, XI_Enter);
|
|
|
b9a760 |
+ XISetMask (mask, XI_Leave);
|
|
|
b9a760 |
+
|
|
|
b9a760 |
+#ifdef HAVE_XINPUT_2_2
|
|
|
b9a760 |
+ /* enable touch event support if we're running on XInput 2.2 */
|
|
|
b9a760 |
+ if (backend_x11->xi_minor >= 2)
|
|
|
b9a760 |
+ {
|
|
|
b9a760 |
+ XISetMask (mask, XI_TouchBegin);
|
|
|
b9a760 |
+ XISetMask (mask, XI_TouchUpdate);
|
|
|
b9a760 |
+ XISetMask (mask, XI_TouchEnd);
|
|
|
b9a760 |
+ }
|
|
|
b9a760 |
+#endif /* HAVE_XINPUT_2_2 */
|
|
|
b9a760 |
+
|
|
|
b9a760 |
+ xi_event_mask.deviceid = XIAllMasterDevices;
|
|
|
b9a760 |
+ xi_event_mask.mask = mask;
|
|
|
b9a760 |
+ xi_event_mask.mask_len = len;
|
|
|
b9a760 |
+
|
|
|
b9a760 |
+ XISelectEvents (backend_x11->xdpy, stage_x11->xwin, &xi_event_mask, 1);
|
|
|
b9a760 |
+
|
|
|
b9a760 |
+ g_free (mask);
|
|
|
b9a760 |
+}
|
|
|
b9a760 |
+
|
|
|
b9a760 |
static ClutterTranslateReturn
|
|
|
b9a760 |
clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
|
|
|
b9a760 |
gpointer native,
|
|
|
b9a760 |
@@ -1483,6 +1526,7 @@ clutter_device_manager_xi2_class_init (ClutterDeviceManagerXI2Class *klass)
|
|
|
b9a760 |
manager_class->get_devices = clutter_device_manager_xi2_get_devices;
|
|
|
b9a760 |
manager_class->get_core_device = clutter_device_manager_xi2_get_core_device;
|
|
|
b9a760 |
manager_class->get_device = clutter_device_manager_xi2_get_device;
|
|
|
b9a760 |
+ manager_class->select_stage_events = clutter_device_manager_xi2_select_stage_events;
|
|
|
b9a760 |
}
|
|
|
b9a760 |
|
|
|
b9a760 |
static void
|
|
|
b9a760 |
diff --git a/clutter/x11/clutter-input-device-xi2.c b/clutter/x11/clutter-input-device-xi2.c
|
|
|
b9a760 |
index cd65b7b..b9e27a5 100644
|
|
|
b9a760 |
--- a/clutter/x11/clutter-input-device-xi2.c
|
|
|
b9a760 |
+++ b/clutter/x11/clutter-input-device-xi2.c
|
|
|
b9a760 |
@@ -54,53 +54,6 @@ G_DEFINE_TYPE (ClutterInputDeviceXI2,
|
|
|
b9a760 |
CLUTTER_TYPE_INPUT_DEVICE);
|
|
|
b9a760 |
|
|
|
b9a760 |
static void
|
|
|
b9a760 |
-clutter_input_device_xi2_select_stage_events (ClutterInputDevice *device,
|
|
|
b9a760 |
- ClutterStage *stage)
|
|
|
b9a760 |
-{
|
|
|
b9a760 |
- ClutterInputDeviceXI2 *device_xi2 = CLUTTER_INPUT_DEVICE_XI2 (device);
|
|
|
b9a760 |
- ClutterBackendX11 *backend_x11;
|
|
|
b9a760 |
- ClutterStageX11 *stage_x11;
|
|
|
b9a760 |
- XIEventMask xi_event_mask;
|
|
|
b9a760 |
- unsigned char *mask;
|
|
|
b9a760 |
- int len;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- backend_x11 = CLUTTER_BACKEND_X11 (device->backend);
|
|
|
b9a760 |
- stage_x11 = CLUTTER_STAGE_X11 (_clutter_stage_get_window (stage));
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- len = XIMaskLen (XI_LASTEVENT);
|
|
|
b9a760 |
- mask = g_new0 (unsigned char, len);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- XISetMask (mask, XI_Motion);
|
|
|
b9a760 |
- XISetMask (mask, XI_ButtonPress);
|
|
|
b9a760 |
- XISetMask (mask, XI_ButtonRelease);
|
|
|
b9a760 |
- XISetMask (mask, XI_KeyPress);
|
|
|
b9a760 |
- XISetMask (mask, XI_KeyRelease);
|
|
|
b9a760 |
- XISetMask (mask, XI_Enter);
|
|
|
b9a760 |
- XISetMask (mask, XI_Leave);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
-#ifdef HAVE_XINPUT_2_2
|
|
|
b9a760 |
- /* enable touch event support if we're running on XInput 2.2 */
|
|
|
b9a760 |
- if (backend_x11->xi_minor >= 2)
|
|
|
b9a760 |
- {
|
|
|
b9a760 |
- XISetMask (mask, XI_TouchBegin);
|
|
|
b9a760 |
- XISetMask (mask, XI_TouchUpdate);
|
|
|
b9a760 |
- XISetMask (mask, XI_TouchEnd);
|
|
|
b9a760 |
- }
|
|
|
b9a760 |
-#endif /* HAVE_XINPUT_2_2 */
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- xi_event_mask.deviceid = device_xi2->device_id;
|
|
|
b9a760 |
- xi_event_mask.mask = mask;
|
|
|
b9a760 |
- xi_event_mask.mask_len = len;
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- CLUTTER_NOTE (BACKEND, "Selecting device id '%d' events",
|
|
|
b9a760 |
- device_xi2->device_id);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- XISelectEvents (backend_x11->xdpy, stage_x11->xwin, &xi_event_mask, 1);
|
|
|
b9a760 |
-
|
|
|
b9a760 |
- g_free (mask);
|
|
|
b9a760 |
-}
|
|
|
b9a760 |
-
|
|
|
b9a760 |
-static void
|
|
|
b9a760 |
clutter_input_device_xi2_constructed (GObject *gobject)
|
|
|
b9a760 |
{
|
|
|
b9a760 |
ClutterInputDeviceXI2 *device_xi2 = CLUTTER_INPUT_DEVICE_XI2 (gobject);
|
|
|
b9a760 |
@@ -133,7 +86,6 @@ clutter_input_device_xi2_class_init (ClutterInputDeviceXI2Class *klass)
|
|
|
b9a760 |
|
|
|
b9a760 |
gobject_class->constructed = clutter_input_device_xi2_constructed;
|
|
|
b9a760 |
|
|
|
b9a760 |
- device_class->select_stage_events = clutter_input_device_xi2_select_stage_events;
|
|
|
b9a760 |
device_class->keycode_to_evdev = clutter_input_device_xi2_keycode_to_evdev;
|
|
|
b9a760 |
}
|
|
|
b9a760 |
|
|
|
b9a760 |
--
|
|
|
b9a760 |
1.8.4.2
|
|
|
b9a760 |
|