diff options
author | Owen Taylor <otaylor@src.gnome.org> | 2000-03-14 19:57:25 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2000-03-14 19:57:25 +0000 |
commit | 10ba4fd066042b4335ae45e7560565872f71ba9b (patch) | |
tree | 17f68ffb0d402b6e66bb891d4a7d9a02a9b6108b /gtk/gtkdnd.c | |
parent | 3f98a849c70ae570b78095cef0152a33ec07c64e (diff) | |
download | gtk+-10ba4fd066042b4335ae45e7560565872f71ba9b.tar.gz |
Merges from gtk-1-2
Diffstat (limited to 'gtk/gtkdnd.c')
-rw-r--r-- | gtk/gtkdnd.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c index a6fd6e95d9..43b19e47fa 100644 --- a/gtk/gtkdnd.c +++ b/gtk/gtkdnd.c @@ -553,6 +553,17 @@ gtk_drag_get_event_actions (GdkEvent *event, *suggested_action = GDK_ACTION_LINK; } } + else + { + *possible_actions = actions; + + if (actions & GDK_ACTION_COPY) + *suggested_action = GDK_ACTION_COPY; + else if (actions & GDK_ACTION_MOVE) + *suggested_action = GDK_ACTION_MOVE; + else if (actions & GDK_ACTION_LINK) + *suggested_action = GDK_ACTION_LINK; + } return; } @@ -1680,13 +1691,12 @@ gtk_drag_begin (GtkWidget *widget, gtk_drag_get_event_actions (event, info->button, actions, &suggested_action, &possible_actions); - if (event) - info->cursor = gtk_drag_get_cursor (suggested_action); + info->cursor = gtk_drag_get_cursor (suggested_action); /* Set cur_x, cur_y here so if the "drag_begin" signal shows * the drag icon, it will be in the right place */ - if (event->type == GDK_MOTION_NOTIFY) + if (event && event->type == GDK_MOTION_NOTIFY) { info->cur_x = event->motion.x_root; info->cur_y = event->motion.y_root; @@ -1703,7 +1713,7 @@ gtk_drag_begin (GtkWidget *widget, gtk_signal_emit_by_name (GTK_OBJECT (widget), "drag_begin", info->context); - if (event->type == GDK_MOTION_NOTIFY) + if (event && event->type == GDK_MOTION_NOTIFY) gtk_drag_motion_cb (info->ipc_widget, (GdkEventMotion *)event, info); info->start_x = info->cur_x; |