[mutter/wip/rstrode/rhel-8.0.0: 72/117] cursor-tracker: Add 'cursor-moved' signal
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/rstrode/rhel-8.0.0: 72/117] cursor-tracker: Add 'cursor-moved' signal
- Date: Sun, 17 Feb 2019 17:28:53 +0000 (UTC)
commit 63cee05c65ff4529ae9d4923544e1f0821dd3548
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Wed Dec 12 11:27:16 2018 +0100
cursor-tracker: Add 'cursor-moved' signal
https://gitlab.gnome.org/GNOME/mutter/merge_requests/357
src/backends/meta-cursor-tracker.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
---
diff --git a/src/backends/meta-cursor-tracker.c b/src/backends/meta-cursor-tracker.c
index 6244f11ee..060b6af3b 100644
--- a/src/backends/meta-cursor-tracker.c
+++ b/src/backends/meta-cursor-tracker.c
@@ -48,6 +48,7 @@ G_DEFINE_TYPE (MetaCursorTracker, meta_cursor_tracker, G_TYPE_OBJECT);
enum {
CURSOR_CHANGED,
+ CURSOR_MOVED,
LAST_SIGNAL
};
@@ -158,6 +159,15 @@ meta_cursor_tracker_class_init (MetaCursorTrackerClass *klass)
0,
NULL, NULL, NULL,
G_TYPE_NONE, 0);
+
+ signals[CURSOR_MOVED] = g_signal_new ("cursor-moved",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL, NULL,
+ G_TYPE_NONE, 2,
+ G_TYPE_FLOAT,
+ G_TYPE_FLOAT);
}
/**
@@ -334,6 +344,8 @@ meta_cursor_tracker_update_position (MetaCursorTracker *tracker,
g_assert (meta_is_wayland_compositor ());
meta_cursor_renderer_set_position (cursor_renderer, new_x, new_y);
+
+ g_signal_emit (tracker, signals[CURSOR_MOVED], 0, new_x, new_y);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]