Bug 546490 - [GTK] Incorrect Table/Tree size
Summary: [GTK] Incorrect Table/Tree size
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.11   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.13 M3   Edit
Assignee: Eric Williams CLA
QA Contact:
URL:
Whiteboard: RHT
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2019-04-16 15:29 EDT by Patrick Tasse CLA
Modified: 2021-09-02 19:08 EDT (History)
1 user (show)

See Also:


Attachments
Snippet for Table (4.12 KB, text/x-java)
2019-04-16 15:30 EDT, Patrick Tasse CLA
no flags Details
Snippet for Tree (4.06 KB, text/x-java)
2019-04-16 15:30 EDT, Patrick Tasse CLA
no flags Details
Screenshot for GTK 3.10.8 (170.68 KB, image/png)
2019-04-16 15:31 EDT, Patrick Tasse CLA
no flags Details
Screenshot for GTK 3.22.30 (216.62 KB, image/png)
2019-04-16 15:31 EDT, Patrick Tasse CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Tasse CLA 2019-04-16 15:29:33 EDT
Many errors related to Table and Tree size and packing of columns are demonstrated by the included snippets and screenshots.

Table #1 with no items, 5 columns packed
expected: height = header height, width = sum of packed columns
actual 3.10: height = 1 pixel too much, fixed after resize
actual 3.22: headers not drawn

Table #2 with no items, 5 columns width=0
expected: height = header height, width = 0
actual 3.10: width = 64
actual 3.22: width = 64

Table #3 with no items, 5 columns width=100
expected: height = header height, width = 500
actual 3.10: all OK
actual 3.22: headers not drawn

Table #4 with 5 items, 5 columns width=100
expected: height = header height + 5 x item height, width = 500
actual 3.10: height = 5 x item height, fixed after resize
actual 3.22: height = 5 x item height, fixed after resize

Table #5 with 5 items, 5 columns packed
expected: height = header height + 5 x item height, width = 500
actual 3.10: height = 5 x item height, fixed after resize
actual 3.22: height = 5 x item height, fixed after resize

Shell with 5 tables, packed
expected: height = sum of children heights, width = max of children widths
actual 3.10: height is more than what is drawn
actual 3.22: height is more than what is drawn

Tree #1 with no items, 5 columns packed
expected: height = header height, width = sum of packed columns
actual 3.10: size = 64x64
actual 3.22: size = 64x64

Tree #2 with no items, 5 columns width=0
expected: height = header height, width = 0
actual 3.10: size = 64x64
actual 3.22: size = 64x64

Tree #3 with no items, 5 columns width=100
expected: height = header height, width = 500
actual 3.10: height = 64, fixed after resize
actual 3.22: height = 64, fixed after resize but headers no longer drawn

Tree #4 with 5 items, 5 columns width=100
expected: height = header height + 5 x item height, width = 500
actual 3.10: height = 5 x item height, fixed after resize
actual 3.22: height = 5 x item height, fixed after resize

Tree #5 with 5 items, 5 columns packed
expected: height = header height + 5 x item height, width = 500
actual 3.10: height = 5 x item height, fixed after resize, pack ignores header
actual 3.22: height = 5 x item height, fixed after resize, pack ignores header

Shell with 5 trees, packed
expected: height = sum of children heights, width = max of children widths
actual 3.10: OK, height is equal to what is drawn
actual 3.22: OK, height is equal to what is drawn
Comment 1 Patrick Tasse CLA 2019-04-16 15:30:29 EDT
Created attachment 278303 [details]
Snippet for Table
Comment 2 Patrick Tasse CLA 2019-04-16 15:30:53 EDT
Created attachment 278304 [details]
Snippet for Tree
Comment 3 Patrick Tasse CLA 2019-04-16 15:31:22 EDT
Created attachment 278305 [details]
Screenshot for GTK 3.10.8
Comment 4 Patrick Tasse CLA 2019-04-16 15:31:44 EDT
Created attachment 278306 [details]
Screenshot for GTK 3.22.30
Comment 5 Patrick Tasse CLA 2019-04-16 15:43:21 EDT
More errors just noticed:

Table #1 with no items, 5 columns packed
actual 3.10: pack slightly off for column 0

Table #5 with 5 items, 5 columns packed
actual 3.10: pack slightly off for column 0

Tree #4 with 5 items, 5 columns width=100
actual 3.10: column 0 alignment = SWT.LEFT, expected SWT.CENTER
actual 3.22: column 0 alignment = SWT.LEFT, expected SWT.CENTER
Comment 6 Eric Williams CLA 2019-04-16 16:08:40 EDT
Which Ubuntu(s) was used to test this? Which desktop environment and GTK theme?

I can reproduce some of these, I'll post a detailed write up either later today or tomorrow.
Comment 7 Eric Williams CLA 2019-04-16 16:20:10 EDT
(In reply to Patrick Tasse from comment #0)
> Many errors related to Table and Tree size and packing of columns are
> demonstrated by the included snippets and screenshots.

Just to preface, my results are all on GTK3.24/Fedora 29.
 
> Table #1 with no items, 5 columns packed
> expected: height = header height, width = sum of packed columns
> actual 3.10: height = 1 pixel too much, fixed after resize
> actual 3.22: headers not drawn

I can't reproduce this, the headers draw perfectly fine for me.


> Table #2 with no items, 5 columns width=0
> expected: height = header height, width = 0
> actual 3.10: width = 64
> actual 3.22: width = 64

Reproducible. Is the header supposed to be shown here? I just have a small yellow area like in your screenshot.


> Table #3 with no items, 5 columns width=100
> expected: height = header height, width = 500
> actual 3.10: all OK
> actual 3.22: headers not drawn

Not reproducible, same case as table #1.

 
> Table #4 with 5 items, 5 columns width=100
> expected: height = header height + 5 x item height, width = 500
> actual 3.10: height = 5 x item height, fixed after resize
> actual 3.22: height = 5 x item height, fixed after resize

Reproducible.

 
> Table #5 with 5 items, 5 columns packed
> expected: height = header height + 5 x item height, width = 500
> actual 3.10: height = 5 x item height, fixed after resize
> actual 3.22: height = 5 x item height, fixed after resize

Reproducible.
 

> Shell with 5 tables, packed
> expected: height = sum of children heights, width = max of children widths
> actual 3.10: height is more than what is drawn
> actual 3.22: height is more than what is drawn

Reproducible.

 
> Tree #1 with no items, 5 columns packed
> expected: height = header height, width = sum of packed columns
> actual 3.10: size = 64x64
> actual 3.22: size = 64x64

Reproducible. Again, should a header be drawn here?

 
> Tree #2 with no items, 5 columns width=0
> expected: height = header height, width = 0
> actual 3.10: size = 64x64
> actual 3.22: size = 64x64

Reproducible.

 
> Tree #3 with no items, 5 columns width=100
> expected: height = header height, width = 500
> actual 3.10: height = 64, fixed after resize
> actual 3.22: height = 64, fixed after resize but headers no longer drawn

Can't reproduce the lack of headers, but everything else reproduces.

 
> Tree #4 with 5 items, 5 columns width=100
> expected: height = header height + 5 x item height, width = 500
> actual 3.10: height = 5 x item height, fixed after resize
> actual 3.22: height = 5 x item height, fixed after resize

Reproducible.
 
> Tree #5 with 5 items, 5 columns packed
> expected: height = header height + 5 x item height, width = 500
> actual 3.10: height = 5 x item height, fixed after resize, pack ignores
> header
> actual 3.22: height = 5 x item height, fixed after resize, pack ignores
> header

Reproducible.

 
> Shell with 5 trees, packed
> expected: height = sum of children heights, width = max of children widths
> actual 3.10: OK, height is equal to what is drawn
> actual 3.22: OK, height is equal to what is drawn

Same here.


(In reply to Patrick Tasse from comment #5)
> More errors just noticed:
> 
> Table #1 with no items, 5 columns packed
> actual 3.10: pack slightly off for column 0
>
> Table #5 with 5 items, 5 columns packed
> actual 3.10: pack slightly off for column 0

These are 3.10 only so I can't comment.


> Tree #4 with 5 items, 5 columns width=100
> actual 3.10: column 0 alignment = SWT.LEFT, expected SWT.CENTER
> actual 3.22: column 0 alignment = SWT.LEFT, expected SWT.CENTER

Reproducible.
Comment 8 Patrick Tasse CLA 2019-04-16 16:25:04 EDT
gtk 3.10.8 : Ubuntu 14.04, gnome, Ambiance
gtk 3.22.30: Ubuntu 18.04, gnome, Ambiance
Comment 9 Patrick Tasse CLA 2019-04-16 16:42:26 EDT
(In reply to Eric Williams from comment #7)

> > Table #2 with no items, 5 columns width=0
> > expected: height = header height, width = 0
> > actual 3.10: width = 64
> > actual 3.22: width = 64
> 
> Reproducible. Is the header supposed to be shown here? I just have a small
> yellow area like in your screenshot.

I would expect the table to have zero width, I'm not sure if a widget with no width can still have a height? It's not really visible.

I tried with Composite, setting size to (0,0), (100,0) and (0,100), all three were drawn with size (0,0).

> > Tree #1 with no items, 5 columns packed
> > expected: height = header height, width = sum of packed columns
> > actual 3.10: size = 64x64
> > actual 3.22: size = 64x64
> 
> Reproducible. Again, should a header be drawn here?

I think so, I expected it to look like Table #1 on gtk 3.10, but probably it is not drawn because the pack ignores the header text and sets column widths to zero. If that was the correct packing behaviour, I would expect tree width to be zero, not 64.
Comment 10 Eric Williams CLA 2019-04-17 16:43:43 EDT
It just occurred to me that we can probably track the header issues in bug 541427.
Comment 12 Eric Williams CLA 2019-08-02 09:29:39 EDT
(In reply to Eclipse Genie from comment #11)
> Gerrit change https://git.eclipse.org/r/146886 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=133ff2c44262645cab8b617b0cf983f04cad10ed

Tree fixes are in master now, will address the Table issues next week.
Comment 13 Eclipse Genie CLA 2019-08-07 11:05:42 EDT
New Gerrit change created: https://git.eclipse.org/r/147203
Comment 14 Patrick Tasse CLA 2019-08-08 10:02:00 EDT
Just noticed that this is not fixed:

Tree #4 with 5 items, 5 columns width=100
actual 3.22: column 0 alignment = SWT.LEFT, expected SWT.CENTER
Comment 15 Eric Williams CLA 2019-08-08 10:07:38 EDT
(In reply to Patrick Tasse from comment #14)
> Just noticed that this is not fixed:
> 
> Tree #4 with 5 items, 5 columns width=100
> actual 3.22: column 0 alignment = SWT.LEFT, expected SWT.CENTER

Let's track that separately just for the sake of a clean history. Please open a new ticket for the alignment issues, thanks!
Comment 17 Eric Williams CLA 2019-08-08 10:46:35 EDT
(In reply to Eclipse Genie from comment #16)
> Gerrit change https://git.eclipse.org/r/147203 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=c25bd073db68c302b4c2ec26b608ed1856ea4e6e

Table patch is in master now. Thanks for the detailed bug report and snippets!
Comment 18 Eric Williams CLA 2019-08-20 10:21:43 EDT
Verified in I20190820-0600.