[gnome-panel] libgnome-panel: fix size request mode



commit 0abc041536efef95cf1ac2b3adb0485e9aeda250
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Tue Apr 27 22:53:19 2021 +0300

    libgnome-panel: fix size request mode
    
    From GTK 3 documentation:
    https://developer.gnome.org/gtk3/stable/GtkWidget.html#geometry-management
    
    For example, when queried in the normal GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH
    mode: First, the default minimum and natural width for each widget in
    the interface will be computed using gtk_widget_get_preferred_width().
    Because the preferred widths for each container depend on the preferred
    widths of their children, this information propagates up the hierarchy,
    and finally a minimum and natural width is determined for the entire
    toplevel. Next, the toplevel will use the minimum width to query for
    the minimum height contextual to that width using
    gtk_widget_get_preferred_height_for_width(), which will also be a
    highly recursive operation.
    
    This sounds like behaviour that we want for vertical panel.
    
    Lets try to use HEIGHT_FOR_WIDTH request mode for vertical panels
    and WIDTH_FOR_HEIGHT for horizontal panels. Size request mode was
    added in b20af7b14d0e without any explanation why it was needed.

 libgnome-panel/gp-applet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/libgnome-panel/gp-applet.c b/libgnome-panel/gp-applet.c
index 9395e6fc6..d307e52c2 100644
--- a/libgnome-panel/gp-applet.c
+++ b/libgnome-panel/gp-applet.c
@@ -612,7 +612,7 @@ gp_applet_get_request_mode (GtkWidget *widget)
   applet = GP_APPLET (widget);
   priv = gp_applet_get_instance_private (applet);
 
-  if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+  if (priv->orientation == GTK_ORIENTATION_VERTICAL)
     return GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH;
 
   return GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT;


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