From 575a4ca28176cc4df4b48982fcbc725545ebe904 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 16 Jul 2020 12:07:20 +0200 Subject: [PATCH] backends: Move away from clutter_input_device_set_enabled() We actually have a set_send_events() vfunc that can enable or disable devices at the libinput and X11 input driver level, so use that. A positive side effect is that those layers will leave the device at a consistent idle state (as opposed to going mute maybe amid user input). https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403 --- src/backends/meta-input-settings.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c index dc38d1c03..38d555bd1 100644 --- a/src/backends/meta-input-settings.c +++ b/src/backends/meta-input-settings.c @@ -1901,16 +1901,18 @@ static void power_save_mode_changed_cb (MetaMonitorManager *manager, gpointer user_data) { + MetaInputSettings *input_settings = user_data; MetaInputSettingsPrivate *priv; ClutterInputDevice *device; MetaLogicalMonitor *logical_monitor; MetaMonitor *builtin; MetaPowerSave power_save_mode; + GDesktopDeviceSendEvents send_events; gboolean on; power_save_mode = meta_monitor_manager_get_power_save_mode (manager); on = power_save_mode == META_POWER_SAVE_ON; - priv = meta_input_settings_get_instance_private (user_data); + priv = meta_input_settings_get_instance_private (input_settings); builtin = meta_monitor_manager_get_laptop_panel (manager); if (!builtin) @@ -1927,7 +1929,13 @@ power_save_mode_changed_cb (MetaMonitorManager *manager, if (!device) return; - clutter_input_device_set_enabled (device, on); + send_events = on ? + G_DESKTOP_DEVICE_SEND_EVENTS_ENABLED : + G_DESKTOP_DEVICE_SEND_EVENTS_DISABLED; + + META_INPUT_SETTINGS_GET_CLASS (input_settings)->set_send_events (input_settings, + device, + send_events); } static void