[mutter/wip/carlosg/input-refactors-pt1: 72/96] backends: Drop the filter for libinput events




commit 0a6c186a3dae23c1f032286befa84ed3b91afdb6
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/1486

 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 8c206b8a24..222acbd0bf 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;
@@ -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)
 {
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]