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



commit fc24d8fa623c4cf841eb5168cb1c250b4a84d4da
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 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/gnome-panel/panel-toplevel.c b/gnome-panel/panel-toplevel.c
index d730867..896242b 100644
--- a/gnome-panel/panel-toplevel.c
+++ b/gnome-panel/panel-toplevel.c
@@ -2690,9 +2690,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);
 }


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