entry: use priv->dnd_position when rendering the DND cursor

This makes "cursor position" track the DnD point again, looks much
more intuitive than just rendering it on the pre-DnD position.

https://bugzilla.gnome.org/show_bug.cgi?id=725866
This commit is contained in:
Carlos Garnacho 2014-03-07 01:19:50 +01:00 committed by Matthias Clasen
parent 8195244e3b
commit adf39dd291

View File

@ -6436,9 +6436,13 @@ gtk_entry_draw_cursor (GtkEntry *entry,
layout = gtk_entry_ensure_layout (entry, TRUE);
text = pango_layout_get_text (layout);
cursor_index = g_utf8_offset_to_pointer (text, priv->current_pos + priv->preedit_cursor) - text;
get_layout_position (entry, &x, &y);
if (type == CURSOR_DND)
cursor_index = g_utf8_offset_to_pointer (text, priv->dnd_position) - text;
else
cursor_index = g_utf8_offset_to_pointer (text, priv->current_pos + priv->preedit_cursor) - text;
if (!priv->overwrite_mode)
block = FALSE;
else