[gnome-panel/gnome-3-8] panel: simplify panel_toplevel_check_resize function



commit 0021c4741af748b634989ac0829d7aab8b103e80
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sat Dec 7 21:24:21 2013 +0200

    panel: simplify panel_toplevel_check_resize function
    
    There is no need to use two GtkAllocation variables. And there is
    no need to set requisition.[width/height] to -1 before using in
    gtk_widget_get_preferred_size.
    
    Signed-off-by: Philipp Kaluza <floss ghostroute eu>

 gnome-panel/panel-toplevel.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/gnome-panel/panel-toplevel.c b/gnome-panel/panel-toplevel.c
index 5f93a2a..d730867 100644
--- a/gnome-panel/panel-toplevel.c
+++ b/gnome-panel/panel-toplevel.c
@@ -2690,11 +2690,9 @@ panel_toplevel_check_resize (GtkContainer *container)
        gtk_widget_get_preferred_size (widget, &requisition, NULL);
        gtk_widget_get_allocation (widget, &allocation);
 
-       if (allocation.width != requisition.width || allocation.height != requisition.height)
-       {
-               allocation.width = requisition.width;
-               allocation.height = requisition.height;
-       }
+       if (allocation.width  != requisition.width ||
+           allocation.height != requisition.height)
+               return;
 
        gtk_widget_size_allocate (widget, &allocation);
 }


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