summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-05-29 15:42:28 +0100
committerXisco Faulí <xiscofauli@libreoffice.org>2019-06-05 11:42:15 +0200
commit60504bffca213f6d5c66d1a2de596c20533b7d9c (patch)
treeba73361efcf0b35fe87cdf745e0592bc087555a4 /vcl
parentcf839dcb09fa117744380d3213cb3cf8d9f363f2 (diff)
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/73174 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/gtk/gtksalframe.cxx19
1 files changed, 18 insertions, 1 deletions
diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx
index b162b5c67848..bf87ed3aba21 100644
--- a/vcl/unx/gtk/gtksalframe.cxx
+++ b/vcl/unx/gtk/gtksalframe.cxx
@@ -875,6 +875,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.
@@ -892,7 +909,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 */