mirror of
https://github.com/brl/mutter.git
synced 2024-12-01 12:20:47 -05:00
backends: Have meta_input_settings_handle_pad_button() take an event
As all the relevant backends are expected to provide ClutterPadButtonEvents, it makes no sense to split the information, plus all other event fields are now available and might be needed in the future. https://bugzilla.gnome.org/show_bug.cgi?id=771098
This commit is contained in:
parent
d6fc41b73e
commit
fff7da2a96
@ -136,9 +136,7 @@ gboolean meta_input_settings_is_pad_button_grabbed (MetaIn
|
|||||||
guint button);
|
guint button);
|
||||||
|
|
||||||
gboolean meta_input_settings_handle_pad_button (MetaInputSettings *input_settings,
|
gboolean meta_input_settings_handle_pad_button (MetaInputSettings *input_settings,
|
||||||
ClutterInputDevice *pad,
|
const ClutterPadButtonEvent *event);
|
||||||
gboolean is_press,
|
|
||||||
guint button);
|
|
||||||
gchar * meta_input_settings_get_pad_button_action_label (MetaInputSettings *input_settings,
|
gchar * meta_input_settings_get_pad_button_action_label (MetaInputSettings *input_settings,
|
||||||
ClutterInputDevice *pad,
|
ClutterInputDevice *pad,
|
||||||
guint button);
|
guint button);
|
||||||
|
@ -1672,16 +1672,20 @@ meta_input_settings_is_pad_button_grabbed (MetaInputSettings *input_settings,
|
|||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_input_settings_handle_pad_button (MetaInputSettings *input_settings,
|
meta_input_settings_handle_pad_button (MetaInputSettings *input_settings,
|
||||||
ClutterInputDevice *pad,
|
const ClutterPadButtonEvent *event)
|
||||||
gboolean is_press,
|
|
||||||
guint button)
|
|
||||||
{
|
{
|
||||||
GDesktopPadButtonAction action;
|
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 (META_IS_INPUT_SETTINGS (input_settings), FALSE);
|
||||||
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (pad), FALSE);
|
g_return_val_if_fail (event->type == CLUTTER_PAD_BUTTON_PRESS ||
|
||||||
g_return_val_if_fail (clutter_input_device_get_device_type (pad) ==
|
event->type == CLUTTER_PAD_BUTTON_RELEASE, FALSE);
|
||||||
CLUTTER_PAD_DEVICE, 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);
|
action = meta_input_settings_get_pad_button_action (input_settings, pad, button);
|
||||||
|
|
||||||
|
@ -223,9 +223,7 @@ meta_display_handle_event (MetaDisplay *display,
|
|||||||
event->type == CLUTTER_PAD_BUTTON_RELEASE))
|
event->type == CLUTTER_PAD_BUTTON_RELEASE))
|
||||||
{
|
{
|
||||||
if (meta_input_settings_handle_pad_button (meta_backend_get_input_settings (backend),
|
if (meta_input_settings_handle_pad_button (meta_backend_get_input_settings (backend),
|
||||||
clutter_event_get_source_device (event),
|
&event->pad_button))
|
||||||
event->type == CLUTTER_PAD_BUTTON_PRESS,
|
|
||||||
event->pad_button.button))
|
|
||||||
{
|
{
|
||||||
bypass_wayland = bypass_clutter = TRUE;
|
bypass_wayland = bypass_clutter = TRUE;
|
||||||
goto out;
|
goto out;
|
||||||
|
Loading…
Reference in New Issue
Block a user