Bug 542867 - [GTK3] Combo pulldown text cutoff on Linux
Summary: [GTK3] Combo pulldown text cutoff on Linux
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.10   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.11 M1   Edit
Assignee: Eric Williams CLA
QA Contact:
URL:
Whiteboard: RHT
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2018-12-17 17:17 EST by Kris De Volder CLA
Modified: 2019-03-13 06:41 EDT (History)
3 users (show)

See Also:


Attachments
Wizard screenshot on Eclipse 4.10 (65.36 KB, image/png)
2018-12-17 17:17 EST, Kris De Volder CLA
no flags Details
Same wizard screenshot on Eclipse 4.9 (65.68 KB, image/png)
2018-12-17 17:20 EST, Kris De Volder CLA
no flags Details
sample-code (12.84 KB, application/zip)
2018-12-17 18:49 EST, Kris De Volder CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kris De Volder CLA 2018-12-17 17:17:03 EST
Created attachment 276946 [details]
Wizard screenshot on Eclipse 4.10

Swithcing from Eclipse 4.9 platform to Eclipse 4.10. The size computations for various of our 'pull down' style text combo widgets are now wrong. They result in text being cut-off and in some cases totally unreadable (if the text is just one character, cutting of any part of the text will do that).

One of my coleagues tried the wizard on Mac and it looks fine there. So this looks to be a regression in Linux SWT only.

I'm attaching two screenshots, one from before Eclipse 4.9 and one from Eclipse 4.10.

This doesn't appear to affect all combo boxes. Some boxes are drawn correctly. I think it has something to do with the fact that the affected boxes are not on screen when the wizard is initially shown. These widgets are added later on (dynamically populated from data read from a web service) and so there are some calls being made to 'reflow/relayout' the page after the widgets have been added or their contents changed somehow.

In fact with the wizard from which these screenshots here are taken, the widgets briefly appear on screen 'correctly' (a bit hard to be sure, as they only appear very briefly) and then they get resized to a smaller size cutting of the contents.

When sized correctly (E 4.9) the widget's width takes into account all of these:

1) text in the widget currently visible on screen
2) the width of the little pull-down arrow.
3) text in the pull-down menu (i.e. the other items that can be chosen by the user could be wider, and the widget acomodates enough space to show the largest of them).

When sized 'incorrectly' (E 4.10) what it looks like to me is that instead only the currently visible text is taken into account. It does not account for the other items in the list, nor the width of the pull-down icon.

I'll see if I can come up with some code snippet to reproduce this problem, and, if able to, will attach it later.
Comment 1 Kris De Volder CLA 2018-12-17 17:20:59 EST
Created attachment 276947 [details]
Same wizard screenshot on Eclipse 4.9
Comment 2 Kris De Volder CLA 2018-12-17 18:49:59 EST
Created attachment 276948 [details]
sample-code

This is an Eclipse plugin. It contributes a 'Sample Menu' with a 'Sample Command'.

To use:

- import into workspace as 'existing Eclipse project'.
- Run As >> Eclipse Application
- Open the "Sample Command".

This will popup a Dialog which shows the misbehaving widgets.

The interesting bits of code are in the class called 'DemoDialog'.
Comment 3 Kris De Volder CLA 2018-12-17 18:55:13 EST
Note: This bug is rather annoying as it 'damages' several of our wizards on Linux and there isn't really a suitable consistent workaround that I could figure out.

In some cases I can make the combo 'grab' horizontal space. But... it looks ugly at best, and at worst, in some cases this agressive space grabbing makes the whole dialog blow up in horizontally.
Comment 4 Xi Yan CLA 2018-12-18 09:14:05 EST
I can reproduce this, and interestingly it only happens on X11 but not Wayland. Looks like a regression from https://git.eclipse.org/r/#/c/129957/
Comment 5 Eric Williams CLA 2018-12-18 09:57:40 EST
Every release, a new Combo bug. :)

I'll investigate.
Comment 6 Eric Williams CLA 2018-12-18 17:03:49 EST
I believe the computeNativeSize() method is returning an incorrect value, I'm working on a fix which, if all goes well, I can upload tomorrow.
Comment 7 Eclipse Genie CLA 2018-12-19 12:07:45 EST
New Gerrit change created: https://git.eclipse.org/r/134263
Comment 9 Eric Williams CLA 2018-12-19 15:04:00 EST
(In reply to Eclipse Genie from comment #8)
> Gerrit change https://git.eclipse.org/r/134263 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=3c2c84010e869bca54123f5d34124263c4b93ac7

In master now.
Comment 10 Eric Williams CLA 2019-01-09 10:45:08 EST
Verified in I20190108-1800.