[x11] Add a command line switch for enabling XInput

Currently, XInput support requires a function call. In order to
make it easier for people to test it, we can also add a command
line switch that moves the pointer device detection and handling
to XInput. This should ensure that, at least for people building
Clutter with --enable-xinput, applications can be easily migrated
and regressions can be caught.
This commit is contained in:
Emmanuele Bassi 2009-06-19 14:32:37 +01:00
parent 0ec541282a
commit 21608fe5f7

View File

@ -95,7 +95,7 @@ static ClutterBackendX11 *backend_singleton = NULL;
/* various flags corresponding to pre init setup calls */
static gboolean _no_xevent_retrieval = FALSE;
static gboolean _enable_xinput = FALSE;
static gboolean clutter_enable_xinput = FALSE;
static Display *_foreign_dpy = NULL;
/* options */
@ -253,8 +253,16 @@ static const GOptionEntry entries[] =
{ "synch", 0,
0,
G_OPTION_ARG_NONE, &clutter_synchronise,
N_("Make X calls synchronous"), NULL,
N_("Make X calls synchronous"), NULL
},
#ifdef HAVE_XINPUT
{
"enable-xinput", 0,
0,
G_OPTION_ARG_NONE, &clutter_enable_xinput,
N_("Enable XInput support"), NULL
},
#endif /* HAVE_XINPUT */
{ NULL }
};
@ -462,7 +470,7 @@ clutter_x11_set_display (Display *xdpy)
* Since: 0.8
*/
void
clutter_x11_enable_xinput ()
clutter_x11_enable_xinput (void)
{
if (_clutter_context_is_initialized ())
{
@ -471,7 +479,7 @@ clutter_x11_enable_xinput ()
return;
}
_enable_xinput = TRUE;
clutter_enable_xinput = TRUE;
}
/**
@ -656,7 +664,7 @@ _clutter_x11_register_xinput ()
return;
}
if (!_enable_xinput)
if (!clutter_enable_xinput)
{
CLUTTER_NOTE (BACKEND, "Not enabling XInput");
return;