Commit fff38851 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Fix middle button pasting in the TextView (#81880, reported by Evert

Sat Mar 13 02:55:51 2004  Matthias Clasen  <maclas@gmx.de>

	Fix middle button pasting in the TextView  (#81880, reported
	by Evert Verhellen, patch by Paolo Borelli):

	* gtk/gtktextview.c (gtk_text_view_button_press_event): Retrieve
	the insert mark and move the cursor to it making sure of also
	scroll the window if needed.

	* gtk/gtktextbuffer.c (pre_paste_prep): Move the insert mark
	to the insertion point.
parent 3186b9e7
Sat Mar 13 02:55:51 2004 Matthias Clasen <maclas@gmx.de>
Fix middle button pasting in the TextView (#81880, reported
by Evert Verhellen, patch by Paolo Borelli):
* gtk/gtktextview.c (gtk_text_view_button_press_event): Retrieve
the insert mark and move the cursor to it making sure of also
scroll the window if needed.
* gtk/gtktextbuffer.c (pre_paste_prep): Move the insert mark
to the insertion point.
Sat Mar 13 01:38:55 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcombobox.c (gtk_combo_box_remove): Add a remove
......
Sat Mar 13 02:55:51 2004 Matthias Clasen <maclas@gmx.de>
Fix middle button pasting in the TextView (#81880, reported
by Evert Verhellen, patch by Paolo Borelli):
* gtk/gtktextview.c (gtk_text_view_button_press_event): Retrieve
the insert mark and move the cursor to it making sure of also
scroll the window if needed.
* gtk/gtktextbuffer.c (pre_paste_prep): Move the insert mark
to the insertion point.
Sat Mar 13 01:38:55 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcombobox.c (gtk_combo_box_remove): Add a remove
......
Sat Mar 13 02:55:51 2004 Matthias Clasen <maclas@gmx.de>
Fix middle button pasting in the TextView (#81880, reported
by Evert Verhellen, patch by Paolo Borelli):
* gtk/gtktextview.c (gtk_text_view_button_press_event): Retrieve
the insert mark and move the cursor to it making sure of also
scroll the window if needed.
* gtk/gtktextbuffer.c (pre_paste_prep): Move the insert mark
to the insertion point.
Sat Mar 13 01:38:55 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcombobox.c (gtk_combo_box_remove): Add a remove
......
Sat Mar 13 02:55:51 2004 Matthias Clasen <maclas@gmx.de>
Fix middle button pasting in the TextView (#81880, reported
by Evert Verhellen, patch by Paolo Borelli):
* gtk/gtktextview.c (gtk_text_view_button_press_event): Retrieve
the insert mark and move the cursor to it making sure of also
scroll the window if needed.
* gtk/gtktextbuffer.c (pre_paste_prep): Move the insert mark
to the insertion point.
Sat Mar 13 01:38:55 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcombobox.c (gtk_combo_box_remove): Add a remove
......
Sat Mar 13 02:55:51 2004 Matthias Clasen <maclas@gmx.de>
Fix middle button pasting in the TextView (#81880, reported
by Evert Verhellen, patch by Paolo Borelli):
* gtk/gtktextview.c (gtk_text_view_button_press_event): Retrieve
the insert mark and move the cursor to it making sure of also
scroll the window if needed.
* gtk/gtktextbuffer.c (pre_paste_prep): Move the insert mark
to the insertion point.
Sat Mar 13 01:38:55 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcombobox.c (gtk_combo_box_remove): Add a remove
......
......@@ -2936,6 +2936,8 @@ pre_paste_prep (ClipboardRequest *request_data,
if (gtk_text_buffer_get_selection_bounds (buffer, &start, &end))
*insert_point = start;
}
gtk_text_buffer_move_mark_by_name (buffer, "insert", insert_point);
}
static void
......
......@@ -3931,6 +3931,7 @@ gtk_text_view_button_press_event (GtkWidget *widget, GdkEventButton *event)
else if (event->button == 2)
{
GtkTextIter iter;
GtkTextMark *mark;
gtk_text_layout_get_iter_at_pixel (text_view->layout,
&iter,
......@@ -3938,9 +3939,21 @@ gtk_text_view_button_press_event (GtkWidget *widget, GdkEventButton *event)
event->y + text_view->yoffset);
gtk_text_buffer_paste_clipboard (get_buffer (text_view),
gtk_widget_get_clipboard (widget, GDK_SELECTION_PRIMARY),
&iter,
text_view->editable);
gtk_widget_get_clipboard (widget, GDK_SELECTION_PRIMARY),
&iter,
text_view->editable);
mark = gtk_text_buffer_get_mark (get_buffer (text_view), "insert");
gtk_text_buffer_get_iter_at_mark (get_buffer (text_view),
&iter,
mark);
gtk_text_buffer_place_cursor (get_buffer (text_view), &iter);
DV(g_print (G_STRLOC": scrolling onscreen\n"));
gtk_text_view_scroll_mark_onscreen (text_view,
gtk_text_buffer_get_mark (get_buffer (text_view),
"insert"));
return TRUE;
}
else if (event->button == 3)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment