diff --git a/widget/src/gtk2/gtk2drawing.c b/widget/src/gtk2/gtk2drawing.c index 2dd4e7aa15d..1bfc36e8eee 100644 --- a/widget/src/gtk2/gtk2drawing.c +++ b/widget/src/gtk2/gtk2drawing.c @@ -1496,9 +1496,15 @@ static gint moz_gtk_caret_paint(GdkDrawable* drawable, GdkRectangle* rect, GdkRectangle* cliprect, GtkTextDirection direction) { + GdkRectangle location = *rect; + if (direction == GTK_TEXT_DIR_RTL) { + /* gtk_draw_insertion_cursor ignores location.width */ + location.x = rect->x + rect->width; + } + ensure_entry_widget(); gtk_draw_insertion_cursor(gEntryWidget, drawable, cliprect, - rect, TRUE, direction, FALSE); + &location, TRUE, direction, FALSE); return MOZ_GTK_SUCCESS; }