[mutter/wip/carlosg/input-thread: 22/48] backends: Assign stage to events in MetaBackend
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/input-thread: 22/48] backends: Assign stage to events in MetaBackend
- Date: Wed, 23 Sep 2020 17:00:26 +0000 (UTC)
commit a9a7e4099922e5c797f2428ff4dbb717633de632
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Jul 31 20:17:31 2020 +0200
backends: Assign stage to events in MetaBackend
Don't do this in the MetaSeatNative, this should be detached from
the stage.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403
src/backends/meta-backend.c | 16 +++++++++++++++-
src/backends/native/meta-seat-native.c | 10 ----------
2 files changed, 15 insertions(+), 11 deletions(-)
---
diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c
index 76b4a69929..139a5a5b5e 100644
--- a/src/backends/meta-backend.c
+++ b/src/backends/meta-backend.c
@@ -175,6 +175,14 @@ struct _MetaBackendPrivate
};
typedef struct _MetaBackendPrivate MetaBackendPrivate;
+typedef struct _MetaBackendSource MetaBackendSource;
+
+struct _MetaBackendSource
+{
+ GSource parent;
+ MetaBackend *backend;
+};
+
static void
initable_iface_init (GInitableIface *initable_iface);
@@ -937,10 +945,13 @@ clutter_source_dispatch (GSource *source,
GSourceFunc callback,
gpointer user_data)
{
+ MetaBackendSource *backend_source = (MetaBackendSource *) source;
ClutterEvent *event = clutter_event_get ();
if (event)
{
+ event->any.stage =
+ CLUTTER_STAGE (meta_backend_get_stage (backend_source->backend));
clutter_do_event (event);
clutter_event_free (event);
}
@@ -966,6 +977,7 @@ static gboolean
init_clutter (MetaBackend *backend,
GError **error)
{
+ MetaBackendSource *backend_source;
GSource *source;
clutter_set_custom_backend_func (meta_get_clutter_backend);
@@ -977,7 +989,9 @@ init_clutter (MetaBackend *backend,
return FALSE;
}
- source = g_source_new (&clutter_source_funcs, sizeof (GSource));
+ source = g_source_new (&clutter_source_funcs, sizeof (MetaBackendSource));
+ backend_source = (MetaBackendSource *) source;
+ backend_source->backend = backend;
g_source_attach (source, NULL);
g_source_unref (source);
diff --git a/src/backends/native/meta-seat-native.c b/src/backends/native/meta-seat-native.c
index 2b28788aa6..d26b653368 100644
--- a/src/backends/native/meta-seat-native.c
+++ b/src/backends/native/meta-seat-native.c
@@ -246,15 +246,6 @@ static void
queue_event (MetaSeatNative *seat,
ClutterEvent *event)
{
- ClutterStage *stage = meta_seat_native_get_stage (seat);
-
- if (!stage)
- {
- /* No stage yet, drop this event on the floor */
- return;
- }
-
- event->any.stage = stage;
_clutter_event_push (event, FALSE);
}
@@ -1339,7 +1330,6 @@ meta_event_dispatch (GSource *g_source,
{
MetaEventSource *source = (MetaEventSource *) g_source;
MetaSeatNative *seat;
- ClutterEvent *event;
seat = source->seat;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]