From c5fc9481c5994575a1f5ea00061e09aebd8ca6fe Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 2 Aug 2023 13:46:29 +0200 Subject: [PATCH] backends/x11: Drop return value from main XEvent handler This return value is unchecked, and may be removed. While at it rename the function to meta_backend_x11_handle_event(). Part-of: --- src/backends/x11/meta-backend-x11.c | 2 +- src/backends/x11/meta-clutter-backend-x11.h | 7 ----- src/backends/x11/meta-event-x11.c | 35 +++------------------ src/backends/x11/meta-event-x11.h | 6 ++-- 4 files changed, 9 insertions(+), 41 deletions(-) diff --git a/src/backends/x11/meta-backend-x11.c b/src/backends/x11/meta-backend-x11.c index 3ed2830a3..00a68452b 100644 --- a/src/backends/x11/meta-backend-x11.c +++ b/src/backends/x11/meta-backend-x11.c @@ -432,7 +432,7 @@ handle_host_xevent (MetaBackend *backend, if (handle_input_event (x11, event)) goto done; - meta_x11_handle_event (backend, event); + meta_backend_x11_handle_event (backend, event); } done: diff --git a/src/backends/x11/meta-clutter-backend-x11.h b/src/backends/x11/meta-clutter-backend-x11.h index 1ce052945..91ce47f77 100644 --- a/src/backends/x11/meta-clutter-backend-x11.h +++ b/src/backends/x11/meta-clutter-backend-x11.h @@ -58,13 +58,6 @@ G_DECLARE_FINAL_TYPE (MetaClutterBackendX11, meta_clutter_backend_x11, META, CLUTTER_BACKEND_X11, ClutterBackend) -typedef enum -{ - META_X11_FILTER_CONTINUE, - META_X11_FILTER_TRANSLATE, - META_X11_FILTER_REMOVE -} MetaX11FilterReturn; - MetaClutterBackendX11 * meta_clutter_backend_x11_new (MetaBackend *backend); void meta_clutter_x11_trap_x_errors (void); diff --git a/src/backends/x11/meta-event-x11.c b/src/backends/x11/meta-event-x11.c index 13b7688e0..132df41ca 100644 --- a/src/backends/x11/meta-event-x11.c +++ b/src/backends/x11/meta-event-x11.c @@ -34,27 +34,17 @@ #include "cogl/cogl-xlib.h" /** - * meta_x11_handle_event: + * meta_backend_x11_handle_event: * @backend: backend * @xevent: pointer to XEvent structure * * This function processes a single X event; it can be used to hook - * into external X11 event processing (for example, a GDK filter - * function). - * - * Return value: #MetaX11FilterReturn. %META_X11_FILTER_REMOVE - * indicates that Clutter has internally handled the event and the - * caller should do no further processing. %META_X11_FILTER_CONTINUE - * indicates that Clutter is either not interested in the event, - * or has used the event to update internal state without taking - * any exclusive action. %META_X11_FILTER_TRANSLATE will not - * occur. + * into external X11 event processing. */ -MetaX11FilterReturn -meta_x11_handle_event (MetaBackend *backend, - XEvent *xevent) +void +meta_backend_x11_handle_event (MetaBackend *backend, + XEvent *xevent) { - MetaX11FilterReturn result; ClutterBackend *clutter_backend; ClutterEvent *event; MetaSeatX11 *seat_x11; @@ -63,17 +53,6 @@ meta_x11_handle_event (MetaBackend *backend, Display *xdisplay; gboolean allocated_event; - /* The return values here are someone approximate; we return - * META_X11_FILTER_REMOVE if a clutter event is - * generated for the event. This mostly, but not entirely, - * corresponds to whether other event processing should be - * excluded. As long as the stage window is not shared with another - * toolkit it should be safe, and never return - * %META_X11_FILTER_REMOVE when more processing is needed. - */ - - result = META_X11_FILTER_CONTINUE; - clutter_backend = meta_backend_get_clutter_backend (backend); xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend)); @@ -93,8 +72,6 @@ meta_x11_handle_event (MetaBackend *backend, if (meta_seat_x11_translate_event (seat_x11, xevent, event)) { _clutter_event_push (event, FALSE); - - result = META_X11_FILTER_REMOVE; } else { @@ -124,6 +101,4 @@ meta_x11_handle_event (MetaBackend *backend, out: if (allocated_event) XFreeEventData (xdisplay, &xevent->xcookie); - - return result; } diff --git a/src/backends/x11/meta-event-x11.h b/src/backends/x11/meta-event-x11.h index 3dfc18b3d..0330c6e5c 100644 --- a/src/backends/x11/meta-event-x11.h +++ b/src/backends/x11/meta-event-x11.h @@ -25,7 +25,7 @@ #include -#include "backends/x11/meta-clutter-backend-x11.h" +#include "backends/x11/meta-backend-x11.h" -MetaX11FilterReturn meta_x11_handle_event (MetaBackend *backend, - XEvent *xevent); +void meta_backend_x11_handle_event (MetaBackend *backend, + XEvent *xevent);