[gtk+/wip/carlosg/event-as-object: 835/844] gdk: Keep reference on tools from motion/button events.
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/carlosg/event-as-object: 835/844] gdk: Keep reference on tools from motion/button events.
- Date: Wed, 13 Dec 2017 17:07:58 +0000 (UTC)
commit 940c9812f17a41b79dac1bef0148d577da7d1c8f
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Oct 31 12:21:29 2017 +0100
gdk: Keep reference on tools from motion/button events.
gdk/gdkevents.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index 1f16884..8a0baba 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -623,6 +623,8 @@ gdk_event_copy (const GdkEvent *event)
if (event->button.axes)
new_event->button.axes = g_memdup (event->button.axes,
sizeof (gdouble) * gdk_device_get_n_axes (event->any.device));
+ if (event->button.tool)
+ g_object_ref (new_event->button.tool);
break;
case GDK_TOUCH_BEGIN:
@@ -638,6 +640,8 @@ gdk_event_copy (const GdkEvent *event)
if (event->motion.axes)
new_event->motion.axes = g_memdup (event->motion.axes,
sizeof (gdouble) * gdk_device_get_n_axes (event->any.device));
+ if (event->motion.tool)
+ g_object_ref (new_event->motion.tool);
break;
case GDK_SELECTION_CLEAR:
@@ -2107,9 +2111,9 @@ gdk_event_set_device_tool (GdkEvent *event,
{
if (event->any.type == GDK_BUTTON_PRESS ||
event->any.type == GDK_BUTTON_RELEASE)
- event->button.tool = tool;
+ g_set_object (&event->button.tool, tool);
else if (event->any.type == GDK_MOTION_NOTIFY)
- event->motion.tool = tool;
+ g_set_object (&event->motion.tool, tool);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]