mirror of
https://github.com/brl/mutter.git
synced 2024-12-22 19:12:04 +00:00
cursor-tracker: Use our own marshal for cursor-moved
By putting `NULL` as the C marshaller in `g_signal_new`, you automatically get `g_cclosure_marshaller_generic`, which will try to process its arguments and return value with the help of libffi and GValue. Using `glib-genmarshal` and valist_marshallers, we can prevent this so that we need less instructions for each signal emission. https://gitlab.gnome.org/GNOME/mutter/merge_requests/697
This commit is contained in:
parent
aae9f3a3e6
commit
efe6c13d93
@ -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,10 +171,14 @@ 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);
|
||||
g_signal_set_va_marshaller (signals[CURSOR_MOVED],
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
meta_marshal_VOID__FLOAT_FLOATv);
|
||||
|
||||
signals[VISIBILITY_CHANGED] = g_signal_new ("visibility-changed",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
|
@ -657,6 +657,14 @@ 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,
|
||||
valist_marshallers: true,
|
||||
)
|
||||
mutter_built_sources += mutter_marshal
|
||||
|
||||
if have_profiler
|
||||
mutter_sources += [
|
||||
'backends/meta-profiler.c',
|
||||
|
1
src/meta-marshal.list
Normal file
1
src/meta-marshal.list
Normal file
@ -0,0 +1 @@
|
||||
VOID:FLOAT,FLOAT
|
Loading…
Reference in New Issue
Block a user