[gtk+/gtk-3-10] entry: use priv->dnd_position when rendering the DND cursor



commit 9341779f4d84d013b09a2bad270e5aa41db1ca3b
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Mar 7 01:19:50 2014 +0100

    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

 gtk/gtkentry.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index fde81ba..cf5fcf4 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -6342,9 +6342,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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]