diff --git a/src/backends/meta-input-settings-private.h b/src/backends/meta-input-settings-private.h index 0ab537726..18eeb3a51 100644 --- a/src/backends/meta-input-settings-private.h +++ b/src/backends/meta-input-settings-private.h @@ -135,10 +135,8 @@ gboolean meta_input_settings_is_pad_button_grabbed (MetaIn ClutterInputDevice *pad, guint button); -gboolean meta_input_settings_handle_pad_button (MetaInputSettings *input_settings, - ClutterInputDevice *pad, - gboolean is_press, - guint button); +gboolean meta_input_settings_handle_pad_button (MetaInputSettings *input_settings, + const ClutterPadButtonEvent *event); gchar * meta_input_settings_get_pad_button_action_label (MetaInputSettings *input_settings, ClutterInputDevice *pad, guint button); diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c index b8d19791a..a66c69253 100644 --- a/src/backends/meta-input-settings.c +++ b/src/backends/meta-input-settings.c @@ -1671,17 +1671,21 @@ meta_input_settings_is_pad_button_grabbed (MetaInputSettings *input_settings, } gboolean -meta_input_settings_handle_pad_button (MetaInputSettings *input_settings, - ClutterInputDevice *pad, - gboolean is_press, - guint button) +meta_input_settings_handle_pad_button (MetaInputSettings *input_settings, + const ClutterPadButtonEvent *event) { GDesktopPadButtonAction action; + ClutterInputDevice *pad; + gint button, group, mode; + gboolean is_press; g_return_val_if_fail (META_IS_INPUT_SETTINGS (input_settings), FALSE); - g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (pad), FALSE); - g_return_val_if_fail (clutter_input_device_get_device_type (pad) == - CLUTTER_PAD_DEVICE, FALSE); + g_return_val_if_fail (event->type == CLUTTER_PAD_BUTTON_PRESS || + event->type == CLUTTER_PAD_BUTTON_RELEASE, FALSE); + + pad = clutter_event_get_source_device ((ClutterEvent *) event); + button = event->button; + is_press = event->type == CLUTTER_PAD_BUTTON_PRESS; action = meta_input_settings_get_pad_button_action (input_settings, pad, button); diff --git a/src/core/events.c b/src/core/events.c index 6bf75c38e..c8c2a7d74 100644 --- a/src/core/events.c +++ b/src/core/events.c @@ -223,9 +223,7 @@ meta_display_handle_event (MetaDisplay *display, event->type == CLUTTER_PAD_BUTTON_RELEASE)) { if (meta_input_settings_handle_pad_button (meta_backend_get_input_settings (backend), - clutter_event_get_source_device (event), - event->type == CLUTTER_PAD_BUTTON_PRESS, - event->pad_button.button)) + &event->pad_button)) { bypass_wayland = bypass_clutter = TRUE; goto out;