From fa3c5a28a7b82d817ae7b83a058158a101e1e4b0 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 18 Jan 2011 13:15:20 +0000 Subject: [PATCH] backend/x11: Allow querying xinput support Undeprecate the XInput-related X11 API: since we don't enable XI support by default we still need to ask for it, and see if we have it after the backend initialization sequence. --- clutter/x11/clutter-backend-x11.c | 14 ++++++++------ clutter/x11/clutter-backend-x11.h | 5 +---- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/clutter/x11/clutter-backend-x11.c b/clutter/x11/clutter-backend-x11.c index 5162b3d17..cf222714d 100644 --- a/clutter/x11/clutter-backend-x11.c +++ b/clutter/x11/clutter-backend-x11.c @@ -244,7 +244,7 @@ clutter_backend_x11_create_device_manager (ClutterBackendX11 *backend_x11) if (XIQueryVersion (backend_x11->xdpy, &major, &minor) != BadRequest) { CLUTTER_NOTE (BACKEND, "Creating XI2 device manager"); - + backend_x11->has_xinput = TRUE; backend_x11->device_manager = g_object_new (CLUTTER_TYPE_DEVICE_MANAGER_XI2, "backend", backend_x11, @@ -255,11 +255,13 @@ clutter_backend_x11_create_device_manager (ClutterBackendX11 *backend_x11) #endif /* HAVE_XINPUT_2 */ { CLUTTER_NOTE (BACKEND, "Creating Core+XI device manager"); + backend_x11->has_xinput = TRUE; backend_x11->device_manager = g_object_new (CLUTTER_TYPE_DEVICE_MANAGER_X11, "backend", backend_x11, "event-base", first_event, NULL); + } } } @@ -267,6 +269,7 @@ clutter_backend_x11_create_device_manager (ClutterBackendX11 *backend_x11) #endif /* HAVE_XINPUT || HAVE_XINPUT_2 */ { CLUTTER_NOTE (BACKEND, "Creating Core device manager"); + backend_x11->has_xinput = FALSE; backend_x11->device_manager = g_object_new (CLUTTER_TYPE_DEVICE_MANAGER_X11, "backend", backend_x11, @@ -831,8 +834,6 @@ clutter_x11_set_display (Display *xdpy) * want to use clutter_x11_has_xinput() to see if support was enabled. * * Since: 0.8 - * - * Deprecated: 1.6: This function does not do anything. */ void clutter_x11_enable_xinput (void) @@ -1056,14 +1057,15 @@ clutter_x11_get_input_devices (void) * and XInput support is available at run time. * * Since: 0.8 - * - * Deprecated: 1.6 */ gboolean clutter_x11_has_xinput (void) { #if defined(HAVE_XINPUT) || defined(HAVE_XINPUT_2) - return TRUE; + if (backend_singleton != NULL) + return backend_singleton->has_xinput; + + return FALSE; #else return FALSE; #endif diff --git a/clutter/x11/clutter-backend-x11.h b/clutter/x11/clutter-backend-x11.h index 5d710d713..737e13915 100644 --- a/clutter/x11/clutter-backend-x11.h +++ b/clutter/x11/clutter-backend-x11.h @@ -97,13 +97,10 @@ struct _ClutterBackendX11 Atom atom_NET_WM_NAME; Atom atom_UTF8_STRING; - int xi_event_base; - int event_types[CLUTTER_X11_XINPUT_LAST_EVENT]; - gboolean have_xinput; - Time last_event_time; ClutterDeviceManager *device_manager; + gboolean has_xinput; XSettingsClient *xsettings; Window xsettings_xwin;