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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3153>
This commit is contained in:
parent
ca3256ee97
commit
c5fc9481c5
@ -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:
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
#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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user