mirror of
https://github.com/brl/mutter.git
synced 2025-02-18 06:04:10 +00:00
core: Handle special actions associated to pad buttons in generic code
And remove the wayland-specific handling. This works for both Wayland and X11 (provided the compositor receives pad events through a passive grab there). https://bugzilla.gnome.org/show_bug.cgi?id=773779
This commit is contained in:
parent
9abf6892c4
commit
1831a1dd9b
@ -217,6 +217,22 @@ meta_display_handle_event (MetaDisplay *display,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (!display->current_pad_osd &&
|
||||||
|
(event->type == CLUTTER_PAD_BUTTON_PRESS ||
|
||||||
|
event->type == CLUTTER_PAD_BUTTON_RELEASE))
|
||||||
|
{
|
||||||
|
MetaBackend *backend = meta_get_backend ();
|
||||||
|
|
||||||
|
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))
|
||||||
|
{
|
||||||
|
bypass_wayland = bypass_clutter = TRUE;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
source = clutter_event_get_source_device (event);
|
source = clutter_event_get_source_device (event);
|
||||||
|
|
||||||
if (source)
|
if (source)
|
||||||
|
@ -358,26 +358,6 @@ handle_pad_button_event (MetaWaylandTabletPad *pad,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
meta_wayland_tablet_pad_update_action (MetaWaylandTabletPad *pad,
|
|
||||||
const ClutterEvent *event)
|
|
||||||
{
|
|
||||||
MetaInputSettings *input_settings;
|
|
||||||
ClutterInputDevice *device;
|
|
||||||
guint button;
|
|
||||||
|
|
||||||
button = event->pad_button.button;
|
|
||||||
device = clutter_event_get_source_device (event);
|
|
||||||
input_settings = meta_backend_get_input_settings (meta_get_backend ());
|
|
||||||
|
|
||||||
if (!input_settings)
|
|
||||||
return;
|
|
||||||
|
|
||||||
meta_input_settings_handle_pad_button (input_settings, device,
|
|
||||||
event->type == CLUTTER_PAD_BUTTON_PRESS,
|
|
||||||
button);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
meta_wayland_tablet_pad_handle_event_action (MetaWaylandTabletPad *pad,
|
meta_wayland_tablet_pad_handle_event_action (MetaWaylandTabletPad *pad,
|
||||||
const ClutterEvent *event)
|
const ClutterEvent *event)
|
||||||
@ -566,18 +546,6 @@ meta_wayland_tablet_pad_update (MetaWaylandTabletPad *pad,
|
|||||||
|
|
||||||
if (group)
|
if (group)
|
||||||
meta_wayland_tablet_pad_group_update (group, event);
|
meta_wayland_tablet_pad_group_update (group, event);
|
||||||
|
|
||||||
switch (event->type)
|
|
||||||
{
|
|
||||||
case CLUTTER_PAD_BUTTON_PRESS:
|
|
||||||
case CLUTTER_PAD_BUTTON_RELEASE:
|
|
||||||
meta_wayland_tablet_pad_update_action (pad, event);
|
|
||||||
break;
|
|
||||||
case CLUTTER_PAD_RING:
|
|
||||||
case CLUTTER_PAD_STRIP:
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gchar *
|
static gchar *
|
||||||
|
Loading…
x
Reference in New Issue
Block a user