[gnome-panel] panel: simplify panel_toplevel_check_resize function



commit 9441b094c2fa6a54317398b50e6c12545f7ddb96
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.

 gnome-panel/panel-toplevel.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/gnome-panel/panel-toplevel.c b/gnome-panel/panel-toplevel.c
index cf19b9c..3a33821 100644
--- a/gnome-panel/panel-toplevel.c
+++ b/gnome-panel/panel-toplevel.c
@@ -2668,7 +2668,6 @@ static void
 panel_toplevel_check_resize (GtkContainer *container)
 {
        GtkAllocation   allocation;
-       GtkAllocation   widget_allocation;
        GtkRequisition  requisition;
        GtkWidget      *widget;
 
@@ -2677,17 +2676,13 @@ panel_toplevel_check_resize (GtkContainer *container)
        if (!gtk_widget_get_visible (widget))
                return;
 
-       requisition.width  = -1;
-       requisition.height = -1;
-
        gtk_widget_get_preferred_size (widget, &requisition, NULL);
-       gtk_widget_get_allocation (widget, &widget_allocation);
+       gtk_widget_get_allocation (widget, &allocation);
 
-       if (widget_allocation.width  != requisition.width ||
-           widget_allocation.height != requisition.height)
+       if (allocation.width  != requisition.width ||
+           allocation.height != requisition.height)
                return;
 
-       allocation = widget_allocation;
        gtk_widget_size_allocate (widget, &allocation);
 }
 


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