Bug 511133 (TreeIconsMissing) - [GTK3.10+] Some critical icons missing on Ubuntu 16.04
Summary: [GTK3.10+] Some critical icons missing on Ubuntu 16.04
Status: VERIFIED FIXED
Alias: TreeIconsMissing
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.7   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.8 M6   Edit
Assignee: Eric Williams CLA
QA Contact: Eric Williams CLA
URL:
Whiteboard:
Keywords:
: 493213 TreeIconRedrawIssue (view as bug list)
Depends on: 530969
Blocks: 531051 534684
  Show dependency tree
 
Reported: 2017-01-26 14:35 EST by David Williams CLA
Modified: 2018-05-15 06:00 EDT (History)
8 users (show)

See Also:


Attachments
screen shot of refs spec dialog with no icons. (52.34 KB, image/png)
2017-01-26 14:35 EST, David Williams CLA
no flags Details
ref spec dialog on Ubuntu 12.04 showing icon and checkbox (74.60 KB, image/png)
2017-01-28 11:37 EST, David Williams CLA
no flags Details
properties as copied from page in about dialogs "inst details" (15.87 MB, text/plain)
2017-01-28 17:13 EST, David Williams CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Williams CLA 2017-01-26 14:35:33 EST
Created attachment 266477 [details]
screen shot of refs spec dialog with no icons.

I suspect the is fundamentally an SWT problem ... but, as far as I know is related to the types of icons you use, or something. I will attach a screen shot showing the "force" and "remove" icons are missing from the refs spec dialog screen. 

Luckily, the function still works if I click in that general area, but, it is kind of hard to know to do that if I was just starting with this "invisible" version. 

I am running a base system of "Neon.2" which has EGit 4.4.1. 

BTW, in the "console" there are messages that say 

*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug

And, that is literally the console, which I always start and leave open, with -console. There is nothing in the metadata/.log file.
Comment 1 Andrey Loskutov CLA 2017-01-28 10:09:24 EST
David, I see exact same dialog on Windows.

"remove" button has an icon, "force" has no icon, but you mean, both are missing now?
Comment 2 David Williams CLA 2017-01-28 11:34:09 EST
(In reply to Andrey Loskutov from comment #1)
> David, I see exact same dialog on Windows.
> 
> "remove" button has an icon, "force" has no icon, but you mean, both are
> missing now?

Yes. I looked on another machine, and see I misspoke, a little, It is one icon and one checkbox that are missing, not two icons.
Comment 3 David Williams CLA 2017-01-28 11:37:06 EST
Created attachment 266503 [details]
ref spec dialog on Ubuntu 12.04 showing icon and checkbox

This screen shot shows what I was used to seeing, on my Ubuntu 12.04 box. I had recently moved up to 16.04, on another box, and this was one difference that jumped out at me. 

HTH
Comment 4 Andrey Loskutov CLA 2017-01-28 11:58:38 EST
I can confirm that on Windows with latest SWT/EGit the buttons are there. David, can you please update to latest egit (4.6 or nightly) and check that the buttons are missing? It looks like GTK issue, so I've moved the bug to SWT.
Comment 5 David Williams CLA 2017-01-28 17:06:47 EST
(In reply to Andrey Loskutov from comment #4)
> I can confirm that on Windows with latest SWT/EGit the buttons are there.
> David, can you please update to latest egit (4.6 or nightly) and check that
> the buttons are missing? It looks like GTK issue, so I've moved the bug to
> SWT.

Confirmed still "missing" (check box nor icon visible, for this one dialog). 

That's running the latest I-build, with latest EGit from 
http://download.eclipse.org/egit/updates/
(which is EGit 4.6.0). 

Here is what Ubuntu (Linux) says about the version of GTK I am running: 

$ dpkg -l libgtk2.0-0 libgtk-3-0
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                        Version            Architecture       Description
+++-===========================-==================-==================-===========================================================
ii  libgtk-3-0:amd64            3.18.9-1ubuntu3.1  amd64              GTK+ graphical user interface library
ii  libgtk2.0-0:amd64           2.24.30-1ubuntu1.1 amd64              GTK+ graphical user interface library
ii  libgtk2.0-0:i386            2.24.30-1ubuntu1.1 i386               GTK+ graphical user interface library


I did double check, and I do not have any SWT_GTK3 variable defined. 
And, yes, I am running 64 bit. :) 
Will attach "properties".
Comment 6 David Williams CLA 2017-01-28 17:13:00 EST
Created attachment 266504 [details]
properties as copied from page in about dialogs "inst details"

properties ... in case it helps. (Since when did they get so large? Maybe too many "updates"?) 


FYI in this Oxygen version, I also see this "gtk bug" in my *console* window, but does not seem to show up exactly when I pop up that dialog? And nothing in log. 

*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug

Is the "region32" reason to be suspicious of the "bitness" of libraries which get attached?
Comment 7 David Williams CLA 2017-01-28 19:00:22 EST
(In reply to David Williams from comment #5)

> 
> Here is what Ubuntu (Linux) says about the version of GTK I am running: 
> 

Here is what the 12.04 machine says: 

$ dpkg -l libgtk2.0-0 libgtk-3-0
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                        Version            Architecture       Description
+++-===========================-==================-==================-===========================================================
ii  libgtk-3-0:amd64            3.18.9-1ubuntu3.1  amd64              GTK+ graphical user interface library
ii  libgtk2.0-0:amd64           2.24.30-1ubuntu1.1 amd64              GTK+ graphical user interface library


And since the "region32" message sounded suspicious I removed the i386 gtk packages from by 16.04 install -- not sure what needed them, if anything. 

But no difference -- in the checkbox and icon displaying. I no longer saw the *** BUG ***
In pixman_region32
message in console, though. So, maybe an unrelated issue. 
But after removing 
gtk2-engines-pixbug:i386
libgtk2.0-0:i386
gtk2-engines-murrine:i386


Here is what my 16.04 machine says it has: 

$ dpkg -l libgtk2.0-0 libgtk-3-0
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                        Version            Architecture       Description
+++-===========================-==================-==================-===========================================================
ii  libgtk-3-0:amd64            3.18.9-1ubuntu3.1  amd64              GTK+ graphical user interface library
ii  libgtk2.0-0:amd64           2.24.30-1ubuntu1.1 amd64              GTK+ graphical user interface library

As I said, no difference if visibility of those items. 

= = = = = = = = = 

I should probably also mention, another difference between machines is that the 16.04 machine is using a 2560x1440 resolution screen, which is says has a dpi of 96. I was using it for a while with 12.04, and think I would have noticed those icons missing, though. But my remaining 12.04 machine is 1920x1080. I think unrelated, though, since if I switch the 16.04 machine to a lower resolution, I continue to have the same issue. 

= = = = = = =


Sorry for all the data that leads nowhere. Just trying to help rule out issues or narrow down the source.
Comment 8 David Williams CLA 2017-01-28 19:17:01 EST
One more bit of data that leads nowhere: just to be sure, I install a fresh SDK M5, with just EGit added (latest from 'oxygen repo') and still no joy.
Comment 9 Alexander Kurtakov CLA 2018-01-15 15:13:52 EST
David, this should be fixed in latest I-build. Would you please verify?
Comment 10 Eric Williams CLA 2018-01-18 15:33:13 EST
I can reproduce this issue on SWT master as of today, with GTK3.22 and Fedora 27.

I have a JFace snippet that can reproduce the issue: simply run Snippet051TableCenteredImage. On GTK3 the images aren't drawn at all, on GTK2 they are. I'll continue to investigate.
Comment 11 Eric Williams CLA 2018-01-18 17:21:50 EST
Looks like another elusive drawing bug, GTK3.10+ only. GTK3.8 seems to work fine.
Comment 12 Eric Williams CLA 2018-02-06 13:39:33 EST
After some investigating, I have discovered that this bug is caused by a regression from bug 438505. This specifically is what breaks it:

if (parent.getHeaderVisible() && GTK.GTK_VERSION > OS.VERSION(3, 9, 0)) {
	r.y += parent.getHeaderHeightInPixels();
}

I'll continue to investigate a fix that doesn't re-introduce bug 438505.
Comment 13 Eric Williams CLA 2018-02-07 16:06:59 EST
(In reply to Eric Williams from comment #12)
> After some investigating, I have discovered that this bug is caused by a
> regression from bug 438505. This specifically is what breaks it:
> 
> if (parent.getHeaderVisible() && GTK.GTK_VERSION > OS.VERSION(3, 9, 0)) {
> 	r.y += parent.getHeaderHeightInPixels();
> }
> 
> I'll continue to investigate a fix that doesn't re-introduce bug 438505.

The bug seen in EGit/Snippet051TableCenteredImage stems from a coordinate issue. The fix for bug 438505 introduces logic to adjust to paint on the SwtFixed's GdkWindow instead of the GtkTreeView's GdkWindow. Since this window includes any enabled Table headers, the Table geometry API (getClientArea(), getItem(Point p), etc.) was patched to adjust for the height of any Table headers.

This leads to the bug: because EGit/Snippet051 aren't looking up the TableItem via coordinates (Table.getItem(Point p)), the drawing area bounds are being adjusted for the height of the header when no such adjustments are needed. This is a bug in SWT because it breaks the TableItem.getBounds() API.

I've reverted the fix for bug 438505 locally and I'm currently bisecting GTK to find the issue that broke it originally.
Comment 14 Eclipse Genie CLA 2018-02-13 14:50:27 EST
New Gerrit change created: https://git.eclipse.org/r/117300
Comment 16 Eric Williams CLA 2018-02-14 09:01:39 EST
(In reply to Eclipse Genie from comment #15)
> Gerrit change https://git.eclipse.org/r/117300 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=8a745bffa40230e73fb229950d6d0520b474c8f3

Fix is in master now.
Comment 17 Leo Ufimtsev CLA 2018-02-14 09:23:06 EST
Thanks for bugfix.
Comment 18 Eric Williams CLA 2018-02-15 11:41:23 EST
*** Bug 493213 has been marked as a duplicate of this bug. ***
Comment 19 Eric Williams CLA 2018-02-16 11:24:14 EST
*** Bug 529563 has been marked as a duplicate of this bug. ***
Comment 20 Andrey Loskutov CLA 2018-02-27 07:44:11 EST
We've just stumbled upon the table editing regression on GTK3 in 4.7.2 and I've bissected SWT to this bug which *fixes* the problem for us.

Eric, I guess this will be too late for a call for backporting this patch to 4.7.3?
Comment 21 Eric Williams CLA 2018-02-27 09:06:04 EST
(In reply to Andrey Loskutov from comment #20)
> We've just stumbled upon the table editing regression on GTK3 in 4.7.2 and
> I've bissected SWT to this bug which *fixes* the problem for us.
> 
> Eric, I guess this will be too late for a call for backporting this patch to
> 4.7.3?

Yes, sadly it's too late as we are already into RC4. Besides with these more complex Tree/Table fixes I think it's important to let the fix sit in master for awhile to make sure there are absolutely no regressions.
Comment 22 Eric Williams CLA 2018-03-06 09:59:21 EST
Verified in I20180305-2000.
Comment 23 Simeon Andreev CLA 2018-03-07 08:15:58 EST
Hi Eric,

we are trying out the patch here for 4.7.3, and we noticed that some occurrences of the previous fix remain:

diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
index 4f3c86a32d..34c91012d8 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java    
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java    
@@ -400,9 +400,6 @@ Rectangle getBoundsInPixels (int index) {
        }
        int width = OS.gtk_tree_view_column_get_visible (column) ? rect.width + 1 : 0;
        Rectangle r = new Rectangle (rect.x, rect.y, width, rect.height + 1);
-       if (parent.getHeaderVisible() && OS.GTK_VERSION > OS.VERSION(3, 9, 0)) {
-               r.y += parent.getHeaderHeightInPixels();
-       }
        return r;
 }
 
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
index a3e0e8721f..4cf46f1e88 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java     
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java     
@@ -453,9 +453,6 @@ Rectangle getBoundsInPixels (int index) {
        }
        int width = OS.gtk_tree_view_column_get_visible (column) ? rect.width + 1 : 0;
        Rectangle r = new Rectangle (rect.x, rect.y, width, rect.height + 1);
-       if (parent.getHeaderVisible() && OS.GTK_VERSION > OS.VERSION(3, 9, 0)) {
-               r.y += parent.getHeaderHeightInPixels();
-       }
        return r;
 }
 
@@ -520,9 +517,6 @@ Rectangle getBoundsInPixels () {
        }
        int width = OS.gtk_tree_view_column_get_visible (column) ? rect.width + 1 : 0;
        Rectangle r = new Rectangle (rect.x, rect.y, width, rect.height + 1);
-       if (parent.getHeaderVisible() && OS.GTK_VERSION > OS.VERSION(3, 9, 0)) {
-               r.y += parent.getHeaderHeightInPixels();
-       }
        return r;
 }

Maybe those should be removed.

I don't have concrete negative impacts on 4.8, but I definitely see some on 4.7.3.

Best regards,
Simeon
Comment 24 Eric Williams CLA 2018-03-07 09:56:47 EST
(In reply to Simeon Andreev from comment #23)
> Hi Eric,
> 
> we are trying out the patch here for 4.7.3, and we noticed that some
> occurrences of the previous fix remain:
> 
> diff --git a/bundles/org.eclipse.swt/Eclipse
> SWT/gtk/org/eclipse/swt/widgets/TableItem.java
> b/bundles/org.eclipse.swt/Eclipse
> SWT/gtk/org/eclipse/swt/widgets/TableItem.java
> index 4f3c86a32d..34c91012d8 100644
> --- a/bundles/org.eclipse.swt/Eclipse
> SWT/gtk/org/eclipse/swt/widgets/TableItem.java    
> +++ b/bundles/org.eclipse.swt/Eclipse
> SWT/gtk/org/eclipse/swt/widgets/TableItem.java    
> @@ -400,9 +400,6 @@ Rectangle getBoundsInPixels (int index) {
>         }
>         int width = OS.gtk_tree_view_column_get_visible (column) ?
> rect.width + 1 : 0;
>         Rectangle r = new Rectangle (rect.x, rect.y, width, rect.height + 1);
> -       if (parent.getHeaderVisible() && OS.GTK_VERSION > OS.VERSION(3, 9,
> 0)) {
> -               r.y += parent.getHeaderHeightInPixels();
> -       }
>         return r;
>  }
>  
> diff --git a/bundles/org.eclipse.swt/Eclipse
> SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
> b/bundles/org.eclipse.swt/Eclipse
> SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
> index a3e0e8721f..4cf46f1e88 100644
> --- a/bundles/org.eclipse.swt/Eclipse
> SWT/gtk/org/eclipse/swt/widgets/TreeItem.java     
> +++ b/bundles/org.eclipse.swt/Eclipse
> SWT/gtk/org/eclipse/swt/widgets/TreeItem.java     
> @@ -453,9 +453,6 @@ Rectangle getBoundsInPixels (int index) {
>         }
>         int width = OS.gtk_tree_view_column_get_visible (column) ?
> rect.width + 1 : 0;
>         Rectangle r = new Rectangle (rect.x, rect.y, width, rect.height + 1);
> -       if (parent.getHeaderVisible() && OS.GTK_VERSION > OS.VERSION(3, 9,
> 0)) {
> -               r.y += parent.getHeaderHeightInPixels();
> -       }
>         return r;
>  }
>  
> @@ -520,9 +517,6 @@ Rectangle getBoundsInPixels () {
>         }
>         int width = OS.gtk_tree_view_column_get_visible (column) ?
> rect.width + 1 : 0;
>         Rectangle r = new Rectangle (rect.x, rect.y, width, rect.height + 1);
> -       if (parent.getHeaderVisible() && OS.GTK_VERSION > OS.VERSION(3, 9,
> 0)) {
> -               r.y += parent.getHeaderHeightInPixels();
> -       }
>         return r;
>  }
> 
> Maybe those should be removed.

Okay I'll look into it.

 
> I don't have concrete negative impacts on 4.8, but I definitely see some on
> 4.7.3.

Which ones do you see on 4.7.3 that are not on 4.8?
Comment 25 Simeon Andreev CLA 2018-03-08 05:15:10 EST
When we take the patch for our 4.7.3 SWT, SWT cell editors are displaced by the header size.

So they are usually shown 1 row below their actual position.