[mutter/wip/carlosg/input-thread: 66/159] 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: 66/159] backends: Drop the filter for libinput events
- Date: Wed, 12 Aug 2020 17:24:02 +0000 (UTC)
commit 380099314d50e62bfa8899689e08d96d9da2a61c
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.
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 1283f54c2f..9c5296d48a 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;
@@ -2350,40 +2341,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))
@@ -2968,69 +2929,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 31a316c517..06429efdd1 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;
@@ -273,17 +271,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]