Skip to main content
diff options
authorEric Williams2018-12-19 15:21:50 +0000
committerEric Williams2018-12-19 19:49:02 +0000
commit3c2c84010e869bca54123f5d34124263c4b93ac7 (patch)
treec3bf4f16e55d5f40fefda094c59fc100630947b2 /bundles
parentfc80edfc2ecb1d9fb5225ca0426992d70aa233ba (diff)
Bug 542867: [GTK3] Combo pulldown text cutoff on Linux
Enable fit-model on a READ_ONLY Combo's cell renderer when computing size, as it will use the largest item's width to compute the proper size. The fit-model setting can be toggled back to false after performing the compute size operation. Change-Id: I7e5b057e7d3fdd51181cf6b059b03b67dff262d6 Signed-off-by: Eric Williams <>
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/
index fca53d6826..d969c321b4 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/
@@ -461,10 +461,18 @@ Point computeSizeInPixels (int wHint, int hHint, boolean changed) {
Point computeNativeSize (long /*int*/ h, int wHint, int hHint, boolean changed) {
+ // Set fit-model property when computing size, if it was previously disabled
+ if (fitModelToggled) {
+ GTK.gtk_cell_view_set_fit_model(cellHandle, true);
+ }
int [] xpad = new int[1];
if (textRenderer != 0) GTK.gtk_cell_renderer_get_padding(textRenderer, xpad, null);
Point nativeSize = super.computeNativeSize(h, wHint, hHint, changed);
nativeSize.x += xpad[0] * 2;
+ // Re-set fit-model to false as it was before
+ if (fitModelToggled) {
+ GTK.gtk_cell_view_set_fit_model(cellHandle, false);
+ }
return nativeSize;

Back to the top