vcl/unx/gtk3/gtk3gtkinst.cxx | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-)
New commits: commit f2a8f440bf2e8ad9ad0d595d1ab0cecf08de4a5c Author: Caolán McNamara <caol...@redhat.com> Date: Tue Mar 6 17:27:05 2018 +0000 workaround https://gitlab.gnome.org/GNOME/gtk/issues/70 Change-Id: I9175543f691095b843acc97ec3ad7f8299458337 Reviewed-on: https://gerrit.libreoffice.org/50879 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index ef8060662269..4a8912594e45 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -2545,10 +2545,32 @@ private: GtkExpander* m_pExpander; gulong m_nSignalId; - static void signalExpanded(GtkExpander*, GParamSpec *, gpointer widget) + static void signalExpanded(GtkExpander* pExpander, GParamSpec *, gpointer widget) { GtkInstanceExpander* pThis = static_cast<GtkInstanceExpander*>(widget); pThis->signal_expanded(); + + GtkWidget *pToplevel = gtk_widget_get_toplevel(GTK_WIDGET(pExpander)); + + // https://gitlab.gnome.org/GNOME/gtk/issues/70 + // I imagine at some point a release with a fix will be available in which + // case this can be avoided depending on version number + if (pToplevel && GTK_IS_WINDOW(pToplevel) && gtk_widget_get_realized(pToplevel)) + { + int nToplevelWidth, nToplevelHeight; + int nChildHeight; + + GtkWidget* child = gtk_bin_get_child(GTK_BIN(pExpander)); + gtk_widget_get_preferred_height(child, &nChildHeight, nullptr); + gtk_window_get_size(GTK_WINDOW(pToplevel), &nToplevelWidth, &nToplevelHeight); + + if (pThis->get_expanded()) + nToplevelHeight += nChildHeight; + else + nToplevelHeight -= nChildHeight; + + gtk_window_resize(GTK_WINDOW(pToplevel), nToplevelWidth, nToplevelHeight); + } } public: _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits