From c73f45ca7c90af622e604e1edd8e27f4bdd9acc8 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 3 Mar 2014 23:25:08 +0000 Subject: [PATCH] text: Use the keymap direction when focused If the ClutterText actor has key focus then we should ask for the direction of the key map, instead of the direction of the actor. https://bugzilla.gnome.org/show_bug.cgi?id=705779 --- clutter/clutter-text.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/clutter/clutter-text.c b/clutter/clutter-text.c index 66fff8305..2ce831916 100644 --- a/clutter/clutter-text.c +++ b/clutter/clutter-text.c @@ -49,6 +49,7 @@ #include "clutter-actor-private.h" #include "clutter-animatable.h" +#include "clutter-backend-private.h" #include "clutter-binding-pool.h" #include "clutter-color.h" #include "clutter-debug.h" @@ -539,14 +540,20 @@ clutter_text_create_layout_no_cache (ClutterText *text, if (pango_dir == PANGO_DIRECTION_NEUTRAL) { + ClutterBackend *backend = clutter_get_default_backend (); ClutterTextDirection text_dir; - text_dir = clutter_actor_get_text_direction (CLUTTER_ACTOR (text)); - - if (text_dir == CLUTTER_TEXT_DIRECTION_RTL) - pango_dir = PANGO_DIRECTION_RTL; + if (clutter_actor_has_key_focus (CLUTTER_ACTOR (text))) + pango_dir = _clutter_backend_get_keymap_direction (backend); else - pango_dir = PANGO_DIRECTION_LTR; + { + text_dir = clutter_actor_get_text_direction (CLUTTER_ACTOR (text)); + + if (text_dir == CLUTTER_TEXT_DIRECTION_RTL) + pango_dir = PANGO_DIRECTION_RTL; + else + pango_dir = PANGO_DIRECTION_LTR; + } } pango_context_set_base_dir (clutter_actor_get_pango_context (CLUTTER_ACTOR (text)), pango_dir);