[gnome-shell] st-entry: don't possibly allocate actors a negative size



commit 4e07d0b0737fd557538c7452d4a00d58e0f626c2
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Jun 6 17:56:17 2017 -0700

    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 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/st/st-entry.c b/src/st/st-entry.c
index 82cf5c2..c92991e 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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]