[clutter/clutter-1.20] input-device: Reset the focused actor when it becomes unreactive
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/clutter-1.20] input-device: Reset the focused actor when it becomes unreactive
- Date: Thu, 23 Apr 2015 21:00:03 +0000 (UTC)
commit c3004bbf42f5c046355e5d35a618af51494d15da
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Wed Oct 8 12:11:51 2014 -0700
input-device: Reset the focused actor when it becomes unreactive
https://bugzilla.gnome.org/show_bug.cgi?id=743865
(cherry picked from commit 6c057e3171607d3cbfa61ec57c1fff6c5d72b14c)
Signed-off-by: Emmanuele Bassi <ebassi gnome org>
clutter/clutter-input-device.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/clutter/clutter-input-device.c b/clutter/clutter-input-device.c
index b7de586..49bcfae 100644
--- a/clutter/clutter-input-device.c
+++ b/clutter/clutter-input-device.c
@@ -551,6 +551,9 @@ _clutter_input_device_get_actor (ClutterInputDevice *device,
static void on_cursor_actor_destroy (ClutterActor *actor,
ClutterInputDevice *device);
+static void on_cursor_actor_reactive_changed (ClutterActor *actor,
+ GParamSpec *pspec,
+ ClutterInputDevice *device);
static void
_clutter_input_device_associate_actor (ClutterInputDevice *device,
@@ -576,6 +579,9 @@ _clutter_input_device_associate_actor (ClutterInputDevice *device,
g_signal_connect (actor,
"destroy", G_CALLBACK (on_cursor_actor_destroy),
device);
+ g_signal_connect (actor,
+ "notify::reactive", G_CALLBACK (on_cursor_actor_reactive_changed),
+ device);
_clutter_actor_set_has_pointer (actor, TRUE);
}
@@ -610,6 +616,9 @@ _clutter_input_device_unassociate_actor (ClutterInputDevice *device,
g_signal_handlers_disconnect_by_func (actor,
G_CALLBACK (on_cursor_actor_destroy),
device);
+ g_signal_handlers_disconnect_by_func (actor,
+ G_CALLBACK (on_cursor_actor_reactive_changed),
+ device);
_clutter_actor_set_has_pointer (actor, FALSE);
}
}
@@ -621,6 +630,15 @@ on_cursor_actor_destroy (ClutterActor *actor,
_clutter_input_device_unassociate_actor (device, actor, TRUE);
}
+static void
+on_cursor_actor_reactive_changed (ClutterActor *actor,
+ GParamSpec *pspec,
+ ClutterInputDevice *device)
+{
+ if (!clutter_actor_get_reactive (actor))
+ _clutter_input_device_unassociate_actor (device, actor, FALSE);
+}
+
/*< private >
* clutter_input_device_set_actor:
* @device: a #ClutterInputDevice
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]