[gnome-panel] panel: fix problem when panel size not updated



commit 66f077722a12e44f35dadec8a6e03c3a0e039f86
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun Dec 8 14:07:29 2013 +0200

    panel: fix problem when panel size not updated
    
    1. Don't set requisition->[width/height] to panel->size in
    panel_widget_size_request.
    Example 1: Monitor with 1024x768px resolution with horizontal panel and we want
    rotate it. panel->size is 1024px, when we rotate panel panel_widget_size_request
    is called to get preferred width and height. We expect panel height to be 768px,
    bet it will be set to 1024px. We don't want this.
    Example 2: When enabling show hide buttons again we are forcing width to be
    panel->size and at the end panel total width is arrow width * 2 + panel->size
    which makes panel larger than our screens width.
    
    2. Lets call gtk_widget_size_allocate in panel_toplevel_check_resize always not
    only when size is NOT changed. Doing this will fix these current problems:
    * Making expanded panel unexpanded. Currently applets on right side is not
      available.
    * Starting panel in non expanded state. Currently it is completely useless, no
      applets are shown. Expanding it does not fix it until panel is restarted.
    * Clicking on 'show hide buttons'. Currently buttons simply does not show.
    * Changing panel orientation. Currently after orientation changing applets are
      not updated or even whole panel widget remains in its old orientation.
    * Left / right orientation panels are empty when starting panel.
    * Changing resolution. Currently when resolution is changed panel size is not
      updated making part of panel unavailable if new resolution is smaller.
    
    I am not sure if this is 100% right way to fix these problems, but I think
    better fix this way rather keeping these problems not fixed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=709549
    https://bugzilla.gnome.org/show_bug.cgi?id=704622
    https://bugzilla.gnome.org/show_bug.cgi?id=577767

 gnome-panel/panel-toplevel.c |    5 ++---
 gnome-panel/panel-widget.c   |    8 --------
 2 files changed, 2 insertions(+), 11 deletions(-)
---
diff --git a/gnome-panel/panel-toplevel.c b/gnome-panel/panel-toplevel.c
index 3a33821..f8fb26e 100644
--- a/gnome-panel/panel-toplevel.c
+++ b/gnome-panel/panel-toplevel.c
@@ -2679,9 +2679,8 @@ 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)
-               return;
+       allocation.width = requisition.width;
+       allocation.height = requisition.height;
 
        gtk_widget_size_allocate (widget, &allocation);
 }
diff --git a/gnome-panel/panel-widget.c b/gnome-panel/panel-widget.c
index 88e054d..c76b68a 100644
--- a/gnome-panel/panel-widget.c
+++ b/gnome-panel/panel-widget.c
@@ -1286,14 +1286,6 @@ panel_widget_size_request(GtkWidget *widget, GtkRequisition *requisition)
                }
        }
 
-
-       if (!panel->packed) {
-               if (panel->orient == GTK_ORIENTATION_HORIZONTAL)
-                       requisition->width = panel->size;
-               else
-                       requisition->height = panel->size;
-       }
-
        dont_fill = panel->packed && panel->nb_applets_size_hints != 0;
 
        if (panel->orient == GTK_ORIENTATION_HORIZONTAL) {


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