backends: Make MetaInputMapper take over MetaInputSettings public API

Banish MetaInputSettings from MetaBackend "public" API, it's now meant to
spend the rest of its days in the backend dungeons, maybe hanging
off a thread.

MetaInputMapper replaces all external uses.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
This commit is contained in:
Carlos Garnacho
2020-08-04 14:17:39 +02:00
committed by Marge Bot
parent 9a21482fef
commit 4013bed6e4
7 changed files with 93 additions and 94 deletions

View File

@ -73,6 +73,7 @@ struct _MetaBackendNative
MetaLauncher *launcher;
MetaUdev *udev;
MetaKms *kms;
MetaInputSettings *input_settings;
gulong udev_device_added_handler_id;
};
@ -100,6 +101,7 @@ meta_backend_native_finalize (GObject *object)
g_clear_object (&native->udev);
g_clear_object (&native->kms);
meta_launcher_free (native->launcher);
g_clear_object (&native->input_settings);
G_OBJECT_CLASS (meta_backend_native_parent_class)->finalize (object);
}
@ -235,7 +237,15 @@ meta_backend_native_create_renderer (MetaBackend *backend,
static MetaInputSettings *
meta_backend_native_create_input_settings (MetaBackend *backend)
{
return g_object_new (META_TYPE_INPUT_SETTINGS_NATIVE, NULL);
MetaBackendNative *backend_native = META_BACKEND_NATIVE (backend);
if (!backend_native->input_settings)
{
backend_native->input_settings =
g_object_new (META_TYPE_INPUT_SETTINGS_NATIVE, NULL);
}
return backend_native->input_settings;
}
static MetaLogicalMonitor *
@ -669,7 +679,6 @@ void meta_backend_native_resume (MetaBackendNative *native)
meta_backend_get_monitor_manager (backend);
MetaMonitorManagerKms *monitor_manager_kms =
META_MONITOR_MANAGER_KMS (monitor_manager);
MetaInputSettings *input_settings;
MetaIdleMonitor *idle_monitor;
ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
MetaSeatNative *seat =
@ -691,8 +700,7 @@ void meta_backend_native_resume (MetaBackendNative *native)
idle_monitor = meta_idle_monitor_get_core ();
meta_idle_monitor_reset_idletime (idle_monitor);
input_settings = meta_backend_get_input_settings (backend);
meta_input_settings_maybe_restore_numlock_state (input_settings);
meta_input_settings_maybe_restore_numlock_state (native->input_settings);
clutter_seat_ensure_a11y_state (CLUTTER_SEAT (seat));
}