[mutter/wip/nielsdg/cursor-moved-marshal] cursor-tracker: Use our own marshal for cursor-moved



commit d1358daa52de550e7dfc04141cb34b2323baa30b
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Wed Jul 24 07:42:07 2019 +0200

    cursor-tracker: Use our own marshal for cursor-moved
    
    By putting `NULL` as the C marshaller in `g_signal_new`, you
    automatically get `g_ccode_marshaller_generic`, which will try to
    process its arguments and return value with the help of libffi.
    
    Using `glib-genmarshal`, we can prevent this so that we need less
    instructions for each signal emission.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/697

 src/backends/meta-cursor-tracker.c | 4 +++-
 src/meson.build                    | 7 +++++++
 src/meta-marshal.list              | 1 +
 3 files changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/src/backends/meta-cursor-tracker.c b/src/backends/meta-cursor-tracker.c
index 74481dd1c..1651a522c 100644
--- a/src/backends/meta-cursor-tracker.c
+++ b/src/backends/meta-cursor-tracker.c
@@ -39,6 +39,7 @@
 #include "backends/x11/cm/meta-cursor-sprite-xfixes.h"
 #include "cogl/cogl.h"
 #include "clutter/clutter.h"
+#include "meta-marshal.h"
 #include "meta/main.h"
 #include "meta/meta-x11-errors.h"
 #include "meta/util.h"
@@ -170,7 +171,8 @@ meta_cursor_tracker_class_init (MetaCursorTrackerClass *klass)
                                         G_TYPE_FROM_CLASS (klass),
                                         G_SIGNAL_RUN_LAST,
                                         0,
-                                        NULL, NULL, NULL,
+                                        NULL, NULL,
+                                        meta_marshal_VOID__FLOAT_FLOAT,
                                         G_TYPE_NONE, 2,
                                         G_TYPE_FLOAT,
                                         G_TYPE_FLOAT);
diff --git a/src/meson.build b/src/meson.build
index 515638fe5..8343fd46a 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -657,6 +657,13 @@ dbus_idle_monitor_built_sources = gnome.gdbus_codegen('meta-dbus-idle-monitor',
   )
 mutter_built_sources += dbus_idle_monitor_built_sources
 
+mutter_marshal = gnome.genmarshal('meta-marshal',
+    sources: ['meta-marshal.list'],
+    prefix: 'meta_marshal',
+    internal: true,
+  )
+mutter_built_sources += mutter_marshal
+
 if have_profiler
   mutter_sources += [
     'backends/meta-profiler.c',
diff --git a/src/meta-marshal.list b/src/meta-marshal.list
new file mode 100644
index 000000000..e26b60a8e
--- /dev/null
+++ b/src/meta-marshal.list
@@ -0,0 +1 @@
+VOID:FLOAT,FLOAT


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]