[gtk+] GtkWindow: keep a reference of the widget on focus change.
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkWindow: keep a reference of the widget on focus change.
- Date: Mon, 19 Jul 2010 13:09:32 +0000 (UTC)
commit 4682d563cff99cc92734bfd9bda53eb8e6041ddf
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Jul 19 15:01:04 2010 +0200
GtkWindow: keep a reference of the widget on focus change.
Focus out could lead to the widget being destroyed (for example,
in editable cell renderers when DnD starts), so keep the widget
alive while iterating through the devices.
gtk/gtkwindow.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index a9fa718..ce22ae6 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -5253,6 +5253,8 @@ do_focus_change (GtkWidget *widget,
GdkDeviceManager *device_manager;
GList *devices, *d;
+ g_object_ref (widget);
+
device_manager = gdk_display_get_device_manager (gtk_widget_get_display (widget));
devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER);
devices = g_list_concat (devices, gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_SLAVE));
@@ -5289,6 +5291,7 @@ do_focus_change (GtkWidget *widget,
}
g_list_free (devices);
+ g_object_unref (widget);
}
static gint
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]