From 216366e425ffcbe48ab24780f3f8ab6bfdda0085 Mon Sep 17 00:00:00 2001 From: Karl Tomlinson Date: Fri, 10 Apr 2009 13:30:01 +1200 Subject: [PATCH] Bug 483564. Adjust caret location so that GTK themes draw RTL carets correctly. r+sr=roc --HG-- extra : rebase_source : d3ede4134e9e73b841823547212f1c57144ed4a7 --- widget/src/gtk2/gtk2drawing.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/widget/src/gtk2/gtk2drawing.c b/widget/src/gtk2/gtk2drawing.c index 2dd4e7aa15dd..1bfc36e8eeee 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; }