Fix drag-and-drop to default to GDK_ACTION_MOVE if the drag is within a

2000-11-14  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktextview.c (gtk_text_view_drag_motion): Fix drag-and-drop
	to default to GDK_ACTION_MOVE if the drag is within a single
	widget. Defaults to GDK_ACTION_COPY between widgets.
This commit is contained in:
Havoc Pennington 2000-11-14 21:07:11 +00:00 committed by Havoc Pennington
parent 2672c1173e
commit 6da9e17a1e
8 changed files with 63 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2000-11-14 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_drag_motion): Fix drag-and-drop
to default to GDK_ACTION_MOVE if the drag is within a single
widget. Defaults to GDK_ACTION_COPY between widgets.
Mon Nov 13 14:43:48 2000 Owen Taylor <otaylor@redhat.com>
* demos/Makefile.am (test-inline-pixbufs.h): Fix srcdir != builddir

View File

@ -1,3 +1,9 @@
2000-11-14 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_drag_motion): Fix drag-and-drop
to default to GDK_ACTION_MOVE if the drag is within a single
widget. Defaults to GDK_ACTION_COPY between widgets.
Mon Nov 13 14:43:48 2000 Owen Taylor <otaylor@redhat.com>
* demos/Makefile.am (test-inline-pixbufs.h): Fix srcdir != builddir

View File

@ -1,3 +1,9 @@
2000-11-14 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_drag_motion): Fix drag-and-drop
to default to GDK_ACTION_MOVE if the drag is within a single
widget. Defaults to GDK_ACTION_COPY between widgets.
Mon Nov 13 14:43:48 2000 Owen Taylor <otaylor@redhat.com>
* demos/Makefile.am (test-inline-pixbufs.h): Fix srcdir != builddir

View File

@ -1,3 +1,9 @@
2000-11-14 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_drag_motion): Fix drag-and-drop
to default to GDK_ACTION_MOVE if the drag is within a single
widget. Defaults to GDK_ACTION_COPY between widgets.
Mon Nov 13 14:43:48 2000 Owen Taylor <otaylor@redhat.com>
* demos/Makefile.am (test-inline-pixbufs.h): Fix srcdir != builddir

View File

@ -1,3 +1,9 @@
2000-11-14 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_drag_motion): Fix drag-and-drop
to default to GDK_ACTION_MOVE if the drag is within a single
widget. Defaults to GDK_ACTION_COPY between widgets.
Mon Nov 13 14:43:48 2000 Owen Taylor <otaylor@redhat.com>
* demos/Makefile.am (test-inline-pixbufs.h): Fix srcdir != builddir

View File

@ -1,3 +1,9 @@
2000-11-14 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_drag_motion): Fix drag-and-drop
to default to GDK_ACTION_MOVE if the drag is within a single
widget. Defaults to GDK_ACTION_COPY between widgets.
Mon Nov 13 14:43:48 2000 Owen Taylor <otaylor@redhat.com>
* demos/Makefile.am (test-inline-pixbufs.h): Fix srcdir != builddir

View File

@ -1,3 +1,9 @@
2000-11-14 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_drag_motion): Fix drag-and-drop
to default to GDK_ACTION_MOVE if the drag is within a single
widget. Defaults to GDK_ACTION_COPY between widgets.
Mon Nov 13 14:43:48 2000 Owen Taylor <otaylor@redhat.com>
* demos/Makefile.am (test-inline-pixbufs.h): Fix srcdir != builddir

View File

@ -3818,7 +3818,7 @@ gtk_text_view_drag_motion (GtkWidget *widget,
GtkTextIter end;
GdkRectangle target_rect;
gint bx, by;
text_view = GTK_TEXT_VIEW (widget);
target_rect = text_view->text_window->allocation;
@ -3836,8 +3836,8 @@ gtk_text_view_drag_motion (GtkWidget *widget,
gtk_text_layout_get_iter_at_pixel (text_view->layout,
&newplace,
bx, by);
bx, by);
if (gtk_text_buffer_get_selection_bounds (get_buffer (text_view),
&start, &end) &&
gtk_text_iter_in_range (&newplace, &start, &end))
@ -3847,13 +3847,29 @@ gtk_text_view_drag_motion (GtkWidget *widget,
gtk_text_mark_set_visible (text_view->dnd_mark, FALSE);
}
else
{
{
if (gtk_text_iter_editable (&newplace, text_view->editable))
{
GtkWidget *source_widget;
GdkDragAction suggested_action;
suggested_action = context->suggested_action;
source_widget = gtk_drag_get_source_widget (context);
if (source_widget == widget)
{
/* Default to MOVE, unless the user has
* pressed ctrl or alt to affect available actions
*/
if ((context->actions & GDK_ACTION_MOVE) != 0)
suggested_action = GDK_ACTION_MOVE;
}
gtk_text_mark_set_visible (text_view->dnd_mark,
text_view->cursor_visible);
gdk_drag_status (context, context->suggested_action, time);
gdk_drag_status (context, suggested_action, time);
}
else
{