[gtk+/gtk-2-24-quartz: 15/26] Return a NULL context and don't queue up another drag_begin_idle rather than asserting if the static



commit 8bec04aed6112c6190efa473ce0aef742b13f776
Author: John Ralls <jralls ceridwen us>
Date:   Fri Dec 31 17:31:08 2010 -0800

    Return a NULL context and don't queue up another drag_begin_idle rather than asserting if the static drag_context isn't NULL (meaning that a drag is already in progress).

 gdk/quartz/gdkdnd-quartz.c |    2 +-
 gtk/gtkdnd-quartz.c        |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gdk/quartz/gdkdnd-quartz.c b/gdk/quartz/gdkdnd-quartz.c
index bb70b71..f1ad1bc 100644
--- a/gdk/quartz/gdkdnd-quartz.c
+++ b/gdk/quartz/gdkdnd-quartz.c
@@ -111,7 +111,7 @@ GdkDragContext *
 gdk_drag_begin (GdkWindow     *window,
 		GList         *targets)
 {
-  g_assert (_gdk_quartz_drag_source_context == NULL);
+  g_return_val_if_fail (_gdk_quartz_drag_source_context == NULL, NULL);
   
   /* Create fake context */
   _gdk_quartz_drag_source_context = gdk_drag_context_new ();
diff --git a/gtk/gtkdnd-quartz.c b/gtk/gtkdnd-quartz.c
index 8dd47b9..f2fa063 100644
--- a/gtk/gtkdnd-quartz.c
+++ b/gtk/gtkdnd-quartz.c
@@ -1129,6 +1129,8 @@ gtk_drag_begin_internal (GtkWidget         *widget,
   NSWindow *nswindow;
 
   context = gdk_drag_begin (NULL, NULL);
+  g_return_val_if_fail( context != NULL, NULL);
+
   context->is_source = TRUE;
 
   info = gtk_drag_get_source_info (context, TRUE);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]