mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 10:00:45 -05:00
core: enable XInput2 by default
This is nothing but the beginning, things work with a single pointer/keyboard pair, but will be largely broken with multiple devices interacting simultaneously, so we first need a policy to establish a sensible behavior for extra pointer/keyboard pairs. the MUTTER_USE_CORE_DEVICES envvar has been added to force use of Xlib core events for devices in order to check for regressions.
This commit is contained in:
parent
ac187476ae
commit
b3a9d1b39a
@ -553,7 +553,8 @@ meta_display_open (void)
|
|||||||
the_display->static_gravity_works = g_getenv ("MUTTER_USE_STATIC_GRAVITY") != NULL;
|
the_display->static_gravity_works = g_getenv ("MUTTER_USE_STATIC_GRAVITY") != NULL;
|
||||||
|
|
||||||
meta_bell_init (the_display);
|
meta_bell_init (the_display);
|
||||||
the_display->device_map = meta_device_map_new (the_display, TRUE);
|
the_display->device_map = meta_device_map_new (the_display,
|
||||||
|
meta_get_use_core_devices ());
|
||||||
|
|
||||||
meta_display_init_keys (the_display);
|
meta_display_init_keys (the_display);
|
||||||
|
|
||||||
|
@ -301,6 +301,9 @@ static GSourceFuncs event_funcs = {
|
|||||||
static void
|
static void
|
||||||
meta_clutter_init (void)
|
meta_clutter_init (void)
|
||||||
{
|
{
|
||||||
|
if (!meta_get_use_core_devices ())
|
||||||
|
clutter_x11_enable_xinput ();
|
||||||
|
|
||||||
clutter_x11_set_display (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
|
clutter_x11_set_display (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
|
||||||
clutter_x11_disable_event_retrieval ();
|
clutter_x11_disable_event_retrieval ();
|
||||||
|
|
||||||
@ -414,6 +417,8 @@ meta_init (void)
|
|||||||
meta_set_verbose (TRUE);
|
meta_set_verbose (TRUE);
|
||||||
if (g_getenv ("MUTTER_DEBUG"))
|
if (g_getenv ("MUTTER_DEBUG"))
|
||||||
meta_set_debugging (TRUE);
|
meta_set_debugging (TRUE);
|
||||||
|
if (g_getenv ("MUTTER_USE_CORE_DEVICES"))
|
||||||
|
meta_set_use_core_devices (TRUE);
|
||||||
|
|
||||||
if (g_get_home_dir ())
|
if (g_get_home_dir ())
|
||||||
if (chdir (g_get_home_dir ()) < 0)
|
if (chdir (g_get_home_dir ()) < 0)
|
||||||
|
@ -50,6 +50,7 @@ meta_topic_real_valist (MetaDebugTopic topic,
|
|||||||
static gint verbose_topics = 0;
|
static gint verbose_topics = 0;
|
||||||
static gboolean is_debugging = FALSE;
|
static gboolean is_debugging = FALSE;
|
||||||
static gboolean replace_current = FALSE;
|
static gboolean replace_current = FALSE;
|
||||||
|
static gboolean use_core_devices = FALSE;
|
||||||
static int no_prefix = 0;
|
static int no_prefix = 0;
|
||||||
|
|
||||||
#ifdef WITH_VERBOSE_MODE
|
#ifdef WITH_VERBOSE_MODE
|
||||||
@ -178,6 +179,18 @@ meta_set_debugging (gboolean setting)
|
|||||||
is_debugging = setting;
|
is_debugging = setting;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
meta_get_use_core_devices (void)
|
||||||
|
{
|
||||||
|
return use_core_devices;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_set_use_core_devices (gboolean setting)
|
||||||
|
{
|
||||||
|
use_core_devices = setting;
|
||||||
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_get_replace_current_wm (void)
|
meta_get_replace_current_wm (void)
|
||||||
{
|
{
|
||||||
|
@ -38,6 +38,9 @@ gboolean meta_is_syncing (void);
|
|||||||
void meta_set_syncing (gboolean setting);
|
void meta_set_syncing (gboolean setting);
|
||||||
void meta_set_replace_current_wm (gboolean setting);
|
void meta_set_replace_current_wm (gboolean setting);
|
||||||
|
|
||||||
|
gboolean meta_get_use_core_devices (void);
|
||||||
|
void meta_set_use_core_devices (gboolean setting);
|
||||||
|
|
||||||
void meta_debug_spew_real (const char *format,
|
void meta_debug_spew_real (const char *format,
|
||||||
...) G_GNUC_PRINTF (1, 2);
|
...) G_GNUC_PRINTF (1, 2);
|
||||||
void meta_verbose_real (const char *format,
|
void meta_verbose_real (const char *format,
|
||||||
|
@ -61,15 +61,8 @@ struct _MetaUI
|
|||||||
void
|
void
|
||||||
meta_ui_init (void)
|
meta_ui_init (void)
|
||||||
{
|
{
|
||||||
/* As of 2.91.7, Gdk uses XI2 by default, which conflicts with the
|
if (meta_get_use_core_devices ())
|
||||||
* direct X calls we use - in particular, events caused by calls to
|
|
||||||
* XGrabPointer/XGrabKeyboard are no longer understood by GDK, while
|
|
||||||
* GDK will no longer generate the core XEvents we process.
|
|
||||||
* So at least for now, enforce the previous behavior.
|
|
||||||
*/
|
|
||||||
#if GTK_CHECK_VERSION(2, 91, 7)
|
|
||||||
gdk_disable_multidevice ();
|
gdk_disable_multidevice ();
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!gtk_init_check (NULL, NULL))
|
if (!gtk_init_check (NULL, NULL))
|
||||||
meta_fatal ("Unable to open X display %s\n", XDisplayName (NULL));
|
meta_fatal ("Unable to open X display %s\n", XDisplayName (NULL));
|
||||||
|
Loading…
Reference in New Issue
Block a user