From 28a99f8188724a999f74751501c1e223c2d61a7f Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Wed, 27 Apr 2016 16:01:17 +0200 Subject: [PATCH] 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. X-Scintilla-Bug-URL: https://sourceforge.net/p/scintilla/bugs/1825/ X-Scintilla-Commit-ID: d06e3db3e26842cd136328df17eb6f864b3adc02 --- scintilla/gtk/ScintillaGTK.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scintilla/gtk/ScintillaGTK.cxx b/scintilla/gtk/ScintillaGTK.cxx index 7f1929420..4c0688855 100644 --- a/scintilla/gtk/ScintillaGTK.cxx +++ b/scintilla/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); } -- 2.11.4.GIT