From 24c4ae2522e856a27192287e6f4891c1f89e7fca Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Wed, 27 Apr 2016 16:01:17 +0200 Subject: GTK: Properly ask wText what size it wants to please GTK 3.20 It's not really of any use as we do know any size would do as wText is ours anyway, but GTK 3.20 doesn't like allocating without querying the preferred size beforehand, so do it. As wText has a size_request() of 100x100, this might change how we allocate in case we used to underallocate it, but AFAIK we don't, and it is the real minimum size expected. --- gtk/ScintillaGTK.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 85336ecdd..b737a9468 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -1769,8 +1769,17 @@ void ScintillaGTK::Resize(int width, int height) { alloc.x = 0; alloc.y = 0; - alloc.width = Platform::Maximum(1, width - verticalScrollBarWidth); - alloc.height = Platform::Maximum(1, height - horizontalScrollBarHeight); + alloc.width = 1; + alloc.height = 1; +#if GTK_CHECK_VERSION(3, 0, 0) + // please GTK 3.20 and ask wText what size it wants, although we know it doesn't really need + // anything special as it's ours. + gtk_widget_get_preferred_size(PWidget(wText), &requisition, NULL); + alloc.width = requisition.width; + alloc.height = requisition.height; +#endif + alloc.width = Platform::Maximum(alloc.width, width - verticalScrollBarWidth); + alloc.height = Platform::Maximum(alloc.height, height - horizontalScrollBarHeight); gtk_widget_size_allocate(GTK_WIDGET(PWidget(wText)), &alloc); } -- cgit v1.2.3