Bug 521148 - ScrolledComposite not sizing it's content properly when used in a TabFolder with GTK 3
Summary: ScrolledComposite not sizing it's content properly when used in a TabFolder w...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.8   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2017-08-19 06:02 EDT by Robert Müller CLA
Modified: 2017-08-31 10:08 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Müller CLA 2017-08-19 06:02:04 EDT
If one creates a TabFolder with multiple items and each item gets to contain a ScrolledComposite which itself holds a Composite, then the respective composites (except the one on the pre-selected TabItem) will have a size of zero (even after selecting the respective TabItem in the TabFolder) until the user resizes the window manually.

A demonstration code and further explanation is provided here: https://stackoverflow.com/questions/45654403/scrolledcompsite-in-tabfolder-sizes-content-to-zero/45661933

This appears to only occur when using SWT in combination with GTK 3 on Linux (Linux Mint 18 in my case)

This bug was found by me in eclipse 4.6.1.M20160907-1200 but in a quick test of mine it was also reproducable in the latest eclipse Oxygen stable-release.
Comment 1 Leo Ufimtsev CLA 2017-08-21 10:51:11 EDT
I fixed something related to this issue fairly recently, (~month a go?). 

Could you upload an SWT snippet to reproduce the issue, and I can test it against latest fixes etc...?

Thanks.
Comment 2 Leo Ufimtsev CLA 2017-08-21 10:52:18 EDT
(In reply to Leo Ufimtsev from comment #1)
> Could you upload an SWT snippet to reproduce the issue, and I can test it
> against latest fixes etc...?

(In reply to Robert Müller from comment #0)
> A demonstration code and further explanation is provided here:
> https://stackoverflow.com/questions/45654403/scrolledcompsite-in-tabfolder-
> sizes-content-to-zero/45661933

I clearly have not had my coffee yet. Let me test.
Comment 3 Leo Ufimtsev CLA 2017-08-21 10:56:41 EDT
Issue doesn't reproduce for me. Fedora 26, Gtk3.22.
I.e, I see red background.

You sure you tried with newest SWT?
http://download.eclipse.org/eclipse/downloads/

What's your GTK 3 version that you used? Maybe need to use newer one.
Comment 4 Robert Müller CLA 2017-08-21 12:05:19 EDT
If I'm interpreting it correctly my GTK-version is 3.18.9

However using the latest SWT release (4.8M1) resolved the issue for me... However I'm not exactly sure whether the stand-alone version of SWT uses GTK 2 or 3 on my system. But afaik it should use GTK 3 as the default anyway?
Comment 5 Leo Ufimtsev CLA 2017-08-21 15:13:32 EDT
(In reply to Robert Müller from comment #4)
> If I'm interpreting it correctly my GTK-version is 3.18.9
> 
> However using the latest SWT release (4.8M1) resolved the issue for me...
> However I'm not exactly sure whether the stand-alone version of SWT uses GTK
> 2 or 3 on my system. But afaik it should use GTK 3 as the default anyway?

You can get SWT to print the version of GTK that you're on:

export SWT_LIB_VERSIONS=1
./eclipse

But that only works with new-ish versions of SWT, not something more than a month old.

Yea, Gtk3 is usually used as default these days. Gtk2 support will eventually be dropped in the future. 

If you need this in older SWT version, I recommend trying the newest maintenance builds. We generally try to backport the big stuff, but it's possible that more minor things don't always get backported.

If you need this in older SWT version and maintenace branch doesn't contain the fix: There were a whole bunch of size related fixes, so I'm not exactly sure what fixed it (you'd have to check git history). But if there's a patch that you'd like to be backported, feel free to link to it and we can backport it for you.

Is the issue resolved for you? -> Close fixed?