clutter: Change clutter_do_event() name/signature

It is a bit backwards that events contain information about
the stage they are being handled by. It makes more sense to
specify in the ClutterEvent handling entrypoint the stage
that will handle the event.

As a first step, add this ClutterStage argument, even though
the information is still carried through the event in order to
keep satisfying calls to the getter function.

This entrypoint has been also renamed to clutter_stage_handle_event(),
so that its ownership/namespace is clearer.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3153>
This commit is contained in:
Carlos Garnacho
2023-08-01 02:02:15 +03:00
parent 72c433ef02
commit 2e3d55c948
4 changed files with 22 additions and 20 deletions

View File

@ -1090,6 +1090,7 @@ static gboolean
dispatch_clutter_event (MetaBackend *backend)
{
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
ClutterStage *stage = CLUTTER_STAGE (meta_backend_get_stage (backend));
ClutterEvent *event;
event = clutter_event_get ();
@ -1098,8 +1099,7 @@ dispatch_clutter_event (MetaBackend *backend)
g_warn_if_fail (!priv->in_init ||
event->type == CLUTTER_DEVICE_ADDED);
event->any.stage = CLUTTER_STAGE (meta_backend_get_stage (backend));
clutter_do_event (event);
clutter_stage_handle_event (stage, event);
meta_backend_update_from_event (backend, event);
clutter_event_free (event);
return TRUE;

View File

@ -101,7 +101,8 @@ meta_x11_handle_event (MetaBackend *backend,
while (spin > 0 && (event = clutter_event_get ()))
{
/* forward the event into clutter for emission etc. */
clutter_do_event (event);
clutter_stage_handle_event (CLUTTER_STAGE (meta_backend_get_stage (backend)),
event);
meta_backend_update_from_event (backend, event);
clutter_event_free (event);
--spin;