[Libreoffice-commits] core.git: vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed May 29 20:14:45 UTC 2019


 vcl/unx/gtk/gtksalframe.cxx |   19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

New commits:
commit 4f0f09f9229635aaa7b51ce45222721f035e990d
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed May 29 15:42:28 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed May 29 22:13:32 2019 +0200

    tdf#124694 gtk2 GtkFixed takes the max size of all its children...
    
    as its preferred size, causing it to not clip its child, but try and grow
    instead to match
    
    Change-Id: Ibea269d475a4b35a43b6cab2ab432a830d8ff1ff
    Reviewed-on: https://gerrit.libreoffice.org/73168
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx
index 3316bc0705e6..75526e55a59b 100644
--- a/vcl/unx/gtk/gtksalframe.cxx
+++ b/vcl/unx/gtk/gtksalframe.cxx
@@ -719,6 +719,23 @@ void GtkSalFrame::resizeWindow( long nWidth, long nHeight )
         window_resize(nWidth, nHeight);
 }
 
+// tdf#124694 GtkFixed takes the max size of all its children as its
+// preferred size, causing it to not clip its child, but grow instead.
+
+static void
+ooo_fixed_size_request(GtkWidget*, GtkRequisition* req)
+{
+    req->width = 0;
+    req->height = 0;
+}
+
+static void
+ooo_fixed_class_init(GtkFixedClass *klass)
+{
+    GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
+    widget_class->size_request = ooo_fixed_size_request;
+}
+
 /*
  * Always use a sub-class of GtkFixed we can tag for a11y. This allows us to
  * utilize GAIL for the toplevel window and toolkit implementation incl.
@@ -736,7 +753,7 @@ ooo_fixed_get_type()
             sizeof (GtkFixedClass),
             nullptr,      /* base init */
             nullptr,  /* base finalize */
-            nullptr,     /* class init */
+            reinterpret_cast<GClassInitFunc>(ooo_fixed_class_init), /* class init */
             nullptr, /* class finalize */
             nullptr,                      /* class data */
             sizeof (GtkFixed),         /* instance size */


More information about the Libreoffice-commits mailing list