mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
backends/x11: Drop MetaClutterBackendX11 event filters
These are now unused, and may be removed. Event handling in the backend Display should happen directly from the XEvent handler from now on. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3153>
This commit is contained in:
parent
def478edc8
commit
a5519fe544
@ -40,14 +40,6 @@
|
||||
#include "core/bell.h"
|
||||
#include "meta/meta-backend.h"
|
||||
|
||||
typedef struct _MetaX11EventFilter MetaX11EventFilter;
|
||||
|
||||
struct _MetaX11EventFilter
|
||||
{
|
||||
MetaX11FilterFunc func;
|
||||
gpointer data;
|
||||
};
|
||||
|
||||
typedef struct _MetaClutterBackendX11Private
|
||||
{
|
||||
MetaBackend *backend;
|
||||
@ -265,44 +257,6 @@ meta_clutter_backend_x11_create_stage (ClutterBackend *clutter_backend,
|
||||
return stage;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_clutter_backend_x11_process_event_filters (MetaClutterBackendX11 *clutter_backend_x11,
|
||||
gpointer native,
|
||||
ClutterEvent *event)
|
||||
{
|
||||
XEvent *xevent = native;
|
||||
|
||||
/* X11 filter functions have a higher priority */
|
||||
if (clutter_backend_x11->event_filters != NULL)
|
||||
{
|
||||
GSList *node = clutter_backend_x11->event_filters;
|
||||
|
||||
while (node != NULL)
|
||||
{
|
||||
MetaX11EventFilter *filter = node->data;
|
||||
|
||||
switch (filter->func (xevent, event, filter->data))
|
||||
{
|
||||
case META_X11_FILTER_CONTINUE:
|
||||
break;
|
||||
|
||||
case META_X11_FILTER_TRANSLATE:
|
||||
return TRUE;
|
||||
|
||||
case META_X11_FILTER_REMOVE:
|
||||
return FALSE;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
node = node->next;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_clutter_backend_x11_translate_event (ClutterBackend *clutter_backend,
|
||||
gpointer native,
|
||||
@ -315,11 +269,6 @@ meta_clutter_backend_x11_translate_event (ClutterBackend *clutter_backend,
|
||||
MetaStageX11 *stage_x11;
|
||||
ClutterSeat *seat;
|
||||
|
||||
if (meta_clutter_backend_x11_process_event_filters (clutter_backend_x11,
|
||||
native,
|
||||
event))
|
||||
return TRUE;
|
||||
|
||||
/* we update the event time only for events that can
|
||||
* actually reach Clutter's event queue
|
||||
*/
|
||||
@ -411,56 +360,6 @@ meta_clutter_x11_untrap_x_errors (void)
|
||||
return TrappedErrorCode;
|
||||
}
|
||||
|
||||
void
|
||||
meta_clutter_backend_x11_add_filter (MetaClutterBackendX11 *clutter_backend_x11,
|
||||
MetaX11FilterFunc func,
|
||||
gpointer data)
|
||||
{
|
||||
MetaX11EventFilter *filter;
|
||||
|
||||
g_return_if_fail (func != NULL);
|
||||
|
||||
filter = g_new0 (MetaX11EventFilter, 1);
|
||||
filter->func = func;
|
||||
filter->data = data;
|
||||
|
||||
clutter_backend_x11->event_filters =
|
||||
g_slist_append (clutter_backend_x11->event_filters, filter);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
meta_clutter_backend_x11_remove_filter (MetaClutterBackendX11 *clutter_backend_x11,
|
||||
MetaX11FilterFunc func,
|
||||
gpointer data)
|
||||
{
|
||||
GSList *tmp_list, *this;
|
||||
MetaX11EventFilter *filter;
|
||||
|
||||
g_return_if_fail (func != NULL);
|
||||
|
||||
tmp_list = clutter_backend_x11->event_filters;
|
||||
|
||||
while (tmp_list)
|
||||
{
|
||||
filter = tmp_list->data;
|
||||
this = tmp_list;
|
||||
tmp_list = tmp_list->next;
|
||||
|
||||
if (filter->func == func && filter->data == data)
|
||||
{
|
||||
clutter_backend_x11->event_filters =
|
||||
g_slist_remove_link (clutter_backend_x11->event_filters, this);
|
||||
|
||||
g_slist_free_1 (this);
|
||||
g_free (filter);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
meta_clutter_x11_set_use_stereo_stage (gboolean use_stereo)
|
||||
{
|
||||
|
@ -65,10 +65,6 @@ typedef enum
|
||||
META_X11_FILTER_REMOVE
|
||||
} MetaX11FilterReturn;
|
||||
|
||||
typedef MetaX11FilterReturn (*MetaX11FilterFunc) (XEvent *xev,
|
||||
ClutterEvent *cev,
|
||||
gpointer data);
|
||||
|
||||
MetaClutterBackendX11 * meta_clutter_backend_x11_new (MetaBackend *backend);
|
||||
|
||||
void meta_clutter_x11_trap_x_errors (void);
|
||||
@ -76,13 +72,5 @@ gint meta_clutter_x11_untrap_x_errors (void);
|
||||
|
||||
Window meta_clutter_x11_get_root_window (void);
|
||||
|
||||
void meta_clutter_backend_x11_add_filter (MetaClutterBackendX11 *clutter_backend_x11,
|
||||
MetaX11FilterFunc func,
|
||||
gpointer data);
|
||||
|
||||
void meta_clutter_backend_x11_remove_filter (MetaClutterBackendX11 *clutter_backend_x11,
|
||||
MetaX11FilterFunc func,
|
||||
gpointer data);
|
||||
|
||||
void meta_clutter_x11_set_use_stereo_stage (gboolean use_stereo);
|
||||
gboolean meta_clutter_x11_get_use_stereo_stage (void);
|
||||
|
Loading…
Reference in New Issue
Block a user