Commit be6ae47a authored by Havoc Pennington's avatar Havoc Pennington Committed by Havoc Pennington
Browse files

fix for #50317

2001-09-25  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktextview.c: fix for #50317
parent 1a26412d
2001-09-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c: fix for #50317
2001-09-25 Havoc Pennington <hp@redhat.com> 2001-09-25 Havoc Pennington <hp@redhat.com>
   
* gtk/gtktextview.c (gtk_text_view_key_press_event): use * gtk/gtktextview.c (gtk_text_view_key_press_event): use
gtk_text_iter_can_insert gtk_text_iter_can_insert
* gtk/gtktextbuffer.c: use gtk_text_iter_can_insert * gtk/gtktextbuffer.c: use gtk_text_iter_can_insert
   
* gtk/gtktextiter.c (find_line_log_attrs): fixes, #57611, #57613 * gtk/gtktextiter.c (find_line_log_attrs): fixes, #57611, #57613
......
2001-09-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c: fix for #50317
2001-09-25 Havoc Pennington <hp@redhat.com> 2001-09-25 Havoc Pennington <hp@redhat.com>
   
* gtk/gtktextview.c (gtk_text_view_key_press_event): use * gtk/gtktextview.c (gtk_text_view_key_press_event): use
gtk_text_iter_can_insert gtk_text_iter_can_insert
* gtk/gtktextbuffer.c: use gtk_text_iter_can_insert * gtk/gtktextbuffer.c: use gtk_text_iter_can_insert
   
* gtk/gtktextiter.c (find_line_log_attrs): fixes, #57611, #57613 * gtk/gtktextiter.c (find_line_log_attrs): fixes, #57611, #57613
......
2001-09-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c: fix for #50317
2001-09-25 Havoc Pennington <hp@redhat.com> 2001-09-25 Havoc Pennington <hp@redhat.com>
   
* gtk/gtktextview.c (gtk_text_view_key_press_event): use * gtk/gtktextview.c (gtk_text_view_key_press_event): use
gtk_text_iter_can_insert gtk_text_iter_can_insert
* gtk/gtktextbuffer.c: use gtk_text_iter_can_insert * gtk/gtktextbuffer.c: use gtk_text_iter_can_insert
   
* gtk/gtktextiter.c (find_line_log_attrs): fixes, #57611, #57613 * gtk/gtktextiter.c (find_line_log_attrs): fixes, #57611, #57613
......
2001-09-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c: fix for #50317
2001-09-25 Havoc Pennington <hp@redhat.com> 2001-09-25 Havoc Pennington <hp@redhat.com>
   
* gtk/gtktextview.c (gtk_text_view_key_press_event): use * gtk/gtktextview.c (gtk_text_view_key_press_event): use
gtk_text_iter_can_insert gtk_text_iter_can_insert
* gtk/gtktextbuffer.c: use gtk_text_iter_can_insert * gtk/gtktextbuffer.c: use gtk_text_iter_can_insert
   
* gtk/gtktextiter.c (find_line_log_attrs): fixes, #57611, #57613 * gtk/gtktextiter.c (find_line_log_attrs): fixes, #57611, #57613
......
2001-09-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c: fix for #50317
2001-09-25 Havoc Pennington <hp@redhat.com> 2001-09-25 Havoc Pennington <hp@redhat.com>
   
* gtk/gtktextview.c (gtk_text_view_key_press_event): use * gtk/gtktextview.c (gtk_text_view_key_press_event): use
gtk_text_iter_can_insert gtk_text_iter_can_insert
* gtk/gtktextbuffer.c: use gtk_text_iter_can_insert * gtk/gtktextbuffer.c: use gtk_text_iter_can_insert
   
* gtk/gtktextiter.c (find_line_log_attrs): fixes, #57611, #57613 * gtk/gtktextiter.c (find_line_log_attrs): fixes, #57611, #57613
......
2001-09-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c: fix for #50317
2001-09-25 Havoc Pennington <hp@redhat.com> 2001-09-25 Havoc Pennington <hp@redhat.com>
   
* gtk/gtktextview.c (gtk_text_view_key_press_event): use * gtk/gtktextview.c (gtk_text_view_key_press_event): use
gtk_text_iter_can_insert gtk_text_iter_can_insert
* gtk/gtktextbuffer.c: use gtk_text_iter_can_insert * gtk/gtktextbuffer.c: use gtk_text_iter_can_insert
   
* gtk/gtktextiter.c (find_line_log_attrs): fixes, #57611, #57613 * gtk/gtktextiter.c (find_line_log_attrs): fixes, #57611, #57613
......
2001-09-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c: fix for #50317
2001-09-25 Havoc Pennington <hp@redhat.com> 2001-09-25 Havoc Pennington <hp@redhat.com>
   
* gtk/gtktextview.c (gtk_text_view_key_press_event): use * gtk/gtktextview.c (gtk_text_view_key_press_event): use
gtk_text_iter_can_insert gtk_text_iter_can_insert
* gtk/gtktextbuffer.c: use gtk_text_iter_can_insert * gtk/gtktextbuffer.c: use gtk_text_iter_can_insert
   
* gtk/gtktextiter.c (find_line_log_attrs): fixes, #57611, #57613 * gtk/gtktextiter.c (find_line_log_attrs): fixes, #57611, #57613
......
...@@ -2003,6 +2003,8 @@ _gtk_text_iter_forward_indexable_segment (GtkTextIter *iter) ...@@ -2003,6 +2003,8 @@ _gtk_text_iter_forward_indexable_segment (GtkTextIter *iter)
{ {
/* End of buffer */ /* End of buffer */
g_assert (!_gtk_text_line_is_last (real->line, real->tree));
g_assert (_gtk_text_line_contains_end_iter (real->line, real->tree));
g_assert (gtk_text_iter_is_end (iter)); g_assert (gtk_text_iter_is_end (iter));
check_invariants (iter); check_invariants (iter);
......
...@@ -980,6 +980,8 @@ gtk_text_view_init (GtkTextView *text_view) ...@@ -980,6 +980,8 @@ gtk_text_view_init (GtkTextView *text_view)
text_view->drag_start_x = -1; text_view->drag_start_x = -1;
text_view->drag_start_y = -1; text_view->drag_start_y = -1;
text_view->pending_place_cursor_button = 0;
} }
/** /**
...@@ -3346,6 +3348,7 @@ gtk_text_view_button_press_event (GtkWidget *widget, GdkEventButton *event) ...@@ -3346,6 +3348,7 @@ gtk_text_view_button_press_event (GtkWidget *widget, GdkEventButton *event)
{ {
text_view->drag_start_x = event->x; text_view->drag_start_x = event->x;
text_view->drag_start_y = event->y; text_view->drag_start_y = event->y;
text_view->pending_place_cursor_button = event->button;
} }
else else
{ {
...@@ -3465,12 +3468,13 @@ gtk_text_view_button_release_event (GtkWidget *widget, GdkEventButton *event) ...@@ -3465,12 +3468,13 @@ gtk_text_view_button_release_event (GtkWidget *widget, GdkEventButton *event)
text_view->just_selected_element = FALSE; text_view->just_selected_element = FALSE;
return FALSE; return FALSE;
} }
else else if (text_view->pending_place_cursor_button == event->button)
{ {
GtkTextIter iter; GtkTextIter iter;
/* Unselect everything; probably we were dragging, or clicked /* Unselect everything; we clicked inside selection, but
* without dragging to remove selection. * didn't move by the drag threshold, so just clear selection
* and place cursor.
*/ */
gtk_text_layout_get_iter_at_pixel (text_view->layout, gtk_text_layout_get_iter_at_pixel (text_view->layout,
&iter, &iter,
...@@ -3478,7 +3482,9 @@ gtk_text_view_button_release_event (GtkWidget *widget, GdkEventButton *event) ...@@ -3478,7 +3482,9 @@ gtk_text_view_button_release_event (GtkWidget *widget, GdkEventButton *event)
event->y + text_view->yoffset); event->y + text_view->yoffset);
gtk_text_buffer_place_cursor (get_buffer (text_view), &iter); gtk_text_buffer_place_cursor (get_buffer (text_view), &iter);
text_view->pending_place_cursor_button = 0;
return FALSE; return FALSE;
} }
} }
...@@ -4680,7 +4686,8 @@ gtk_text_view_start_selection_dnd (GtkTextView *text_view, ...@@ -4680,7 +4686,8 @@ gtk_text_view_start_selection_dnd (GtkTextView *text_view,
text_view->drag_start_x = -1; text_view->drag_start_x = -1;
text_view->drag_start_y = -1; text_view->drag_start_y = -1;
text_view->pending_place_cursor_button = 0;
target_list = gtk_target_list_new (target_table, target_list = gtk_target_list_new (target_table,
G_N_ELEMENTS (target_table)); G_N_ELEMENTS (target_table));
......
...@@ -143,6 +143,8 @@ struct _GtkTextView ...@@ -143,6 +143,8 @@ struct _GtkTextView
GtkTextPendingScroll *pending_scroll; GtkTextPendingScroll *pending_scroll;
GdkGC *cursor_gc; GdkGC *cursor_gc;
gint pending_place_cursor_button;
}; };
struct _GtkTextViewClass struct _GtkTextViewClass
......
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