From 4e07d0b0737fd557538c7452d4a00d58e0f626c2 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Tue, 6 Jun 2017 17:56:17 -0700 Subject: [PATCH] st-entry: don't possibly allocate actors a negative size Clutter will complain about this, so protect the code against such edge case. https://bugzilla.gnome.org/show_bug.cgi?id=783484 --- src/st/st-entry.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/st/st-entry.c b/src/st/st-entry.c index 82cf5c22e..c92991e3f 100644 --- a/src/st/st-entry.c +++ b/src/st/st-entry.c @@ -475,7 +475,7 @@ st_entry_allocate (ClutterActor *actor, clutter_actor_allocate (left_icon, &icon_box, flags); /* reduce the size for the entry */ - child_box.x1 += icon_w + priv->spacing; + child_box.x1 = MIN (child_box.x2, child_box.x1 + icon_w + priv->spacing); } if (right_icon) @@ -492,7 +492,7 @@ st_entry_allocate (ClutterActor *actor, clutter_actor_allocate (right_icon, &icon_box, flags); /* reduce the size for the entry */ - child_box.x2 -= icon_w + priv->spacing; + child_box.x2 = MAX (child_box.x1, child_box.x2 - icon_w - priv->spacing); } clutter_actor_get_preferred_height (priv->entry, child_box.x2 - child_box.x1,