diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2014-03-03 23:25:08 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2014-03-03 23:42:33 +0000 |
commit | c73f45ca7c90af622e604e1edd8e27f4bdd9acc8 (patch) | |
tree | 28a7909c250f357de59e4e6055f8e14e9e2d6834 | |
parent | 3209129d6b9031fc4beb4d0c5c6b8a8c05286941 (diff) | |
download | clutter-c73f45ca7c90af622e604e1edd8e27f4bdd9acc8.tar.gz |
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
-rw-r--r-- | clutter/clutter-text.c | 17 |
1 files 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); |