mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 08:00:42 -05:00
backends: Drop the filter for libinput events
This is now unused, and it's arguably any useful to stay. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1486
This commit is contained in:
parent
f00e567417
commit
7698fc4aaf
@ -65,15 +65,6 @@
|
||||
#define BTN_STYLUS3 0x149 /* Linux 4.15 */
|
||||
#endif
|
||||
|
||||
typedef struct _MetaEventFilter MetaEventFilter;
|
||||
|
||||
struct _MetaEventFilter
|
||||
{
|
||||
MetaEvdevFilterFunc func;
|
||||
gpointer data;
|
||||
GDestroyNotify destroy_notify;
|
||||
};
|
||||
|
||||
struct _MetaEventSource
|
||||
{
|
||||
GSource source;
|
||||
@ -2384,40 +2375,10 @@ process_device_event (MetaSeatNative *seat,
|
||||
return handled;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
filter_event (MetaSeatNative *seat,
|
||||
struct libinput_event *event)
|
||||
{
|
||||
gboolean retval = CLUTTER_EVENT_PROPAGATE;
|
||||
MetaEventFilter *filter;
|
||||
GSList *tmp_list;
|
||||
|
||||
tmp_list = seat->event_filters;
|
||||
|
||||
while (tmp_list)
|
||||
{
|
||||
filter = tmp_list->data;
|
||||
retval = filter->func (event, filter->data);
|
||||
tmp_list = tmp_list->next;
|
||||
|
||||
if (retval != CLUTTER_EVENT_PROPAGATE)
|
||||
break;
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void
|
||||
process_event (MetaSeatNative *seat,
|
||||
struct libinput_event *event)
|
||||
{
|
||||
gboolean retval;
|
||||
|
||||
retval = filter_event (seat, event);
|
||||
|
||||
if (retval != CLUTTER_EVENT_PROPAGATE)
|
||||
return;
|
||||
|
||||
if (process_base_event (seat, event))
|
||||
return;
|
||||
if (process_device_event (seat, event))
|
||||
@ -2995,69 +2956,6 @@ meta_seat_native_set_relative_motion_filter (MetaSeatNative *seat,
|
||||
seat->relative_motion_filter_user_data = user_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_seat_native_add_filter: (skip)
|
||||
* @func: (closure data): a filter function
|
||||
* @data: (allow-none): user data to be passed to the filter function, or %NULL
|
||||
* @destroy_notify: (allow-none): function to call on @data when the filter is removed, or %NULL
|
||||
*
|
||||
* Adds an event filter function.
|
||||
*/
|
||||
void
|
||||
meta_seat_native_add_filter (MetaSeatNative *seat,
|
||||
MetaEvdevFilterFunc func,
|
||||
gpointer data,
|
||||
GDestroyNotify destroy_notify)
|
||||
{
|
||||
MetaEventFilter *filter;
|
||||
|
||||
g_return_if_fail (func != NULL);
|
||||
|
||||
filter = g_new0 (MetaEventFilter, 1);
|
||||
filter->func = func;
|
||||
filter->data = data;
|
||||
filter->destroy_notify = destroy_notify;
|
||||
|
||||
seat->event_filters = g_slist_append (seat->event_filters, filter);
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_seat_native_remove_filter: (skip)
|
||||
* @func: a filter function
|
||||
* @data: (allow-none): user data to be passed to the filter function, or %NULL
|
||||
*
|
||||
* Removes the given filter function.
|
||||
*/
|
||||
void
|
||||
meta_seat_native_remove_filter (MetaSeatNative *seat,
|
||||
MetaEvdevFilterFunc func,
|
||||
gpointer data)
|
||||
{
|
||||
MetaEventFilter *filter;
|
||||
GSList *tmp_list;
|
||||
|
||||
g_return_if_fail (func != NULL);
|
||||
|
||||
tmp_list = seat->event_filters;
|
||||
|
||||
while (tmp_list)
|
||||
{
|
||||
filter = tmp_list->data;
|
||||
|
||||
if (filter->func == func && filter->data == data)
|
||||
{
|
||||
if (filter->destroy_notify)
|
||||
filter->destroy_notify (filter->data);
|
||||
g_free (filter);
|
||||
seat->event_filters =
|
||||
g_slist_delete_link (seat->event_filters, tmp_list);
|
||||
return;
|
||||
}
|
||||
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
meta_seat_native_update_xkb_state (MetaSeatNative *seat)
|
||||
{
|
||||
|
@ -114,8 +114,6 @@ struct _MetaSeatNative
|
||||
MetaRelativeMotionFilter relative_motion_filter;
|
||||
gpointer relative_motion_filter_user_data;
|
||||
|
||||
GSList *event_filters;
|
||||
|
||||
MetaKeymapNative *keymap;
|
||||
|
||||
GUdevClient *udev_client;
|
||||
@ -270,17 +268,6 @@ void meta_seat_native_set_relative_motion_filter (MetaSeatNative *seat
|
||||
MetaRelativeMotionFilter filter,
|
||||
gpointer user_data);
|
||||
|
||||
typedef gboolean (* MetaEvdevFilterFunc) (struct libinput_event *event,
|
||||
gpointer data);
|
||||
|
||||
void meta_seat_native_add_filter (MetaSeatNative *seat,
|
||||
MetaEvdevFilterFunc func,
|
||||
gpointer data,
|
||||
GDestroyNotify destroy_notify);
|
||||
void meta_seat_native_remove_filter (MetaSeatNative *seat,
|
||||
MetaEvdevFilterFunc func,
|
||||
gpointer data);
|
||||
|
||||
struct xkb_state * meta_seat_native_get_xkb_state (MetaSeatNative *seat);
|
||||
|
||||
void meta_seat_native_set_keyboard_map (MetaSeatNative *seat,
|
||||
|
Loading…
Reference in New Issue
Block a user