From ba4615cd4bb6c1c230bb864b4b5bc43a4d143f6a Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 13 May 2011 14:26:22 +0100 Subject: [PATCH] text: Check the has_focus flag in selection_paint() It is the only place were it is used, so it should only be checked there, and not in the general paint() implementation. --- clutter/clutter-text.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/clutter/clutter-text.c b/clutter/clutter-text.c index 2439d5378..258ad6a02 100644 --- a/clutter/clutter-text.c +++ b/clutter/clutter-text.c @@ -1384,6 +1384,9 @@ selection_paint (ClutterText *self) ClutterActor *actor = CLUTTER_ACTOR (self); guint8 paint_opacity = clutter_actor_get_paint_opacity (actor); + if (!priv->has_focus) + return; + if (priv->editable && priv->cursor_visible) { const ClutterColor *color; @@ -1965,8 +1968,7 @@ clutter_text_paint (ClutterActor *self) real_opacity); cogl_pango_render_layout (layout, text_x, 0, &color, 0); - if (priv->has_focus) - selection_paint (text); + selection_paint (text); if (clip_set) cogl_clip_pop ();