summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej.hunt@collabora.com>2014-06-13 11:21:38 +0100
committerAndrzej Hunt <andrzej.hunt@collabora.com>2014-06-25 13:04:32 +0100
commiteaa21b726db220c7883453f197aac81a6d35b201 (patch)
tree7023bb8b35e04a46ab31d998acc59831fe10e16a
parent0cea87d60cfdc2bbc7c6b5d5ee9918e283fc7b2c (diff)
Prevent GTK assertions due to scrolled window not being initialised.
Seems to be a gtk bug which we need to work around. The assertions don't actually seem to cause any harm (they just print a bunch of "Gtk-CRITICAL **: IA__gtk_range_get_adjustment: assertion `GTK_IS_RANGE (range)' failed" but probably best to avoid them. Change-Id: I5d1bb20bd5c0569c6d023a6148123208a15b9de2
-rw-r--r--libreofficekit/source/gtk/lokdocview.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libreofficekit/source/gtk/lokdocview.c b/libreofficekit/source/gtk/lokdocview.c
index 43020406c8d2..4a16db012a3b 100644
--- a/libreofficekit/source/gtk/lokdocview.c
+++ b/libreofficekit/source/gtk/lokdocview.c
@@ -47,6 +47,12 @@ static void lok_docview_class_init( LOKDocViewClass* pClass )
static void lok_docview_init( LOKDocView* pDocView )
{
+ // Gtk ScrolledWindow is apparently not fully initialised yet, we specifically
+ // have to set the [hv]adjustment to prevent GTK assertions from firing, see
+ // https://bugzilla.gnome.org/show_bug.cgi?id=438114 for more info.
+ gtk_scrolled_window_set_hadjustment( GTK_SCROLLED_WINDOW( pDocView ), NULL );
+ gtk_scrolled_window_set_vadjustment( GTK_SCROLLED_WINDOW( pDocView ), NULL );
+
pDocView->pEventBox = gtk_event_box_new();
gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW(pDocView),
pDocView->pEventBox );