Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 526200

Summary: [GTK3] Table origin/clientArea results differ between GTK2 & GTK3
Product: [Eclipse Project] Platform Reporter: Michael Seele <mseele>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: ericwill, lufimtse
Version: 4.7.1aKeywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
snippet to reproduce the bug
none
screenshot ubuntu 16.04 gtk2
none
screenshot ubuntu 16.04 gtk3
none
screenshot centos7 gtk2
none
screenshot centos7 gtk3 none

Description Michael Seele CLA 2017-10-18 05:34:26 EDT
Created attachment 271054 [details]
snippet to reproduce the bug

The Results of methods org.eclipse.swt.widgets.Table.getWindowOrigin & org.eclipse.swt.widgets.Table.getClientArea differs between GTK2 & GTK3.

Please see my attached snippet (you have to run it and check the output corrdinates).

If you run the snippet with GTK2, the header height is included. 

If you run the snippet with GTK3, the header height is not included. 

We've tested and reproduced this under Ubuntu 16.04 (gtk3.18.9) and CentOS 7 (gtk3.22.10).
Comment 1 Michael Seele CLA 2017-10-18 05:35:14 EDT
Created attachment 271055 [details]
screenshot ubuntu 16.04 gtk2
Comment 2 Michael Seele CLA 2017-10-18 05:35:31 EDT
Created attachment 271056 [details]
screenshot ubuntu 16.04 gtk3
Comment 3 Michael Seele CLA 2017-10-18 05:35:50 EDT
Created attachment 271057 [details]
screenshot centos7 gtk2
Comment 4 Michael Seele CLA 2017-10-18 05:36:04 EDT
Created attachment 271058 [details]
screenshot centos7 gtk3
Comment 5 Leo Ufimtsev CLA 2017-10-18 17:45:43 EDT
Hello Michael,

Thank you for the detailed bug report.

Maybe in Gtk3 the height of the header needs to be retrieved via CSS or something like that. 

We should investigate. 

Does this cause a lot of trouble at the moment or so so?
Comment 6 Michael Seele CLA 2017-10-19 02:49:50 EDT
Hi Leo,

we've implemented a workaround that adds the header height to the coordinates we get, when we use gtk3. So we found a way to work around this problem, for now.

Anyway, it would make sense to fix this inconsistency.
Comment 7 Eric Williams CLA 2018-03-28 10:58:36 EDT
There have been some Table/Tree fixes lately that affect this. Running the snippet attached on today's master, I see that the origin is the same on GTK2 and GTK3.

As for the client area, the mismatch is in the height/width right? Both the x and y are negative.
Comment 8 Michael Seele CLA 2018-03-29 01:49:48 EDT
It's a mismatch of the getWindowOrigin, x/y and width/height (please see the attached screenshots with the printed values)
Comment 9 Eric Williams CLA 2018-03-29 10:38:33 EDT
(In reply to Michael Seele from comment #8)
> It's a mismatch of the getWindowOrigin, x/y and width/height (please see the
> attached screenshots with the printed values)

Okay, thanks for confirming.
Comment 10 Eric Williams CLA 2018-04-02 12:29:14 EDT
Here is the output I am seeing, running the snippet on master as of today:

GTK3.22 on X11

OS.GTK3: true
origin: Point {106, 168}
clientArea: Rectangle {-1, -26, 614, 206}
bounds: Rectangle {5, 5, 616, 208}


GTK2

OS.GTK3: false
origin: Point {106, 168}
clientArea: Rectangle {-1, -26, 645, 213}
bounds: Rectangle {5, 5, 660, 215}

As far as I can see the two most notable differences are the widths of the clientArea and bounds. There is a 7px difference between the height of the client area and bounds from GTK3 to GTK2, but this is small enough that it's probably due to trimmings and such. If it was a header the difference would be larger, closer to ~25px.

From what I can tell, the width is the problem here, not the height. Are you seeing some different output? Please try running your snippet on the latest I-build and post the results.
Comment 11 Michael Seele CLA 2018-04-04 09:10:47 EDT
> From what I can tell, the width is the problem here, not the height. Are you
> seeing some different output? Please try running your snippet on the latest
> I-build and post the results.

I've tried the snippet under Ubuntu 16.04 (gtk3.18.9) and CentOS 7 (gtk3.22.10) with the I20180403 build and i can confirm that the results i get for GTK3 are correct now.
Comment 12 Eric Williams CLA 2018-04-04 09:57:08 EDT
(In reply to Michael Seele from comment #11)
> I've tried the snippet under Ubuntu 16.04 (gtk3.18.9) and CentOS 7
> (gtk3.22.10) with the I20180403 build and i can confirm that the results i
> get for GTK3 are correct now.

Okay. Is the width discrepancy an issue for you, or shall I close this ticket?
Comment 13 Michael Seele CLA 2018-04-04 10:06:32 EDT
> Okay. Is the width discrepancy an issue for you, or shall I close this
> ticket?

Is not an issue, you can close the ticket as fixed.
Comment 14 Eric Williams CLA 2018-04-04 10:25:55 EDT
(In reply to Michael Seele from comment #13)
> > Okay. Is the width discrepancy an issue for you, or shall I close this
> > ticket?
> 
> Is not an issue, you can close the ticket as fixed.

Okay, thanks for the bug report and for taking the time to make a snippet.