[mutter/wip/carlosg/input-thread: 7/91] backends: Drop the filter for libinput events
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/input-thread: 7/91] backends: Drop the filter for libinput events
- Date: Tue, 6 Oct 2020 21:13:45 +0000 (UTC)
commit fb6507892f1eb3df645f21399fff2baa645e23f7
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed May 6 13:54:23 2020 +0200
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/1403
src/backends/native/meta-seat-native.c | 102 ---------------------------------
src/backends/native/meta-seat-native.h | 13 -----
2 files changed, 115 deletions(-)
---
diff --git a/src/backends/native/meta-seat-native.c b/src/backends/native/meta-seat-native.c
index f766df769a..537a1ad102 100644
--- a/src/backends/native/meta-seat-native.c
+++ b/src/backends/native/meta-seat-native.c
@@ -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;
@@ -2362,40 +2353,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))
@@ -2972,69 +2933,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)
{
diff --git a/src/backends/native/meta-seat-native.h b/src/backends/native/meta-seat-native.h
index aceb3f2137..7945603758 100644
--- a/src/backends/native/meta-seat-native.h
+++ b/src/backends/native/meta-seat-native.h
@@ -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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]