mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 15:40:41 -05:00
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
This commit is contained in:
parent
4b7f2905d6
commit
575a4ca281
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user