summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2011-09-27 17:03:15 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2011-09-27 17:03:15 -0700
commitfda230235ce8879736803dc9e0ae918ce471201f (patch)
tree9ebbbaac094a0b3a7abe037198dfd02b2988d750
parentf4d50ffa3b4237447093c1cef9cbe945d22ceb84 (diff)
downloadsubsurface-fda230235ce8879736803dc9e0ae918ce471201f.tar.gz
Use the correct signal to avoid Gtk-CRITICAL error message
We used the wrong signal - "data-drag-received" is intended to check whether the target will accept the drop. What we want is the "drag-drop" signal which tells the widget that something was dropped on it. Also fix an embarrassing lack of NULL pointer checks in my string comparisons... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--gtk-gui.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gtk-gui.c b/gtk-gui.c
index 985a70e04..701e8fe46 100644
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -524,9 +524,9 @@ static void drag_cb(GtkWidget *widget, GdkDragContext *context,
* this all to figure out which window we're talking about.
*/
source = gtk_drag_get_source_widget(context);
- if (! strcmp(nbd[0].name,gtk_widget_get_name(source)))
+ if (nbd[0].name && ! strcmp(nbd[0].name,gtk_widget_get_name(source)))
nbdp = nbd;
- else if (! strcmp(nbd[1].name,gtk_widget_get_name(source)))
+ else if (nbd[1].name && ! strcmp(nbd[1].name,gtk_widget_get_name(source)))
nbdp = nbd + 1;
else
/* HU? */
@@ -601,7 +601,7 @@ void init_ui(int argc, char **argv)
gtk_notebook_set_group_name(GTK_NOTEBOOK(notebook), notebook_name);
g_signal_connect(notebook, "create-window", G_CALLBACK(create_new_notebook_window), NULL);
gtk_drag_dest_set(notebook, GTK_DEST_DEFAULT_ALL, &notebook_target, 1, GDK_ACTION_MOVE);
- g_signal_connect(notebook, "drag-data-received", G_CALLBACK(drag_cb), notebook);
+ g_signal_connect(notebook, "drag-drop", G_CALLBACK(drag_cb), notebook);
g_signal_connect(notebook, "switch-page", G_CALLBACK(switch_page), NULL);
/* Create the actual divelist */