Community
Participate
Working Groups
Created attachment 272529 [details] Screenshot 1 When horizontal scroll-bar in editor is scrolled the content is redrawn incorrectly. Subjectively looks like eclipse tries to draw editor window multiple times with different indentation from left. The smaller width of window to the left from "Editor" (usually "Project Explorer") - more times it is redrawn. The pixel shift of all draws is approximately equal to left window width. This happens only in Photon + GTK2. Photon + GTK3, Oxygen + GTK2/3, Neon + GTK2/3 work normally. Usage of GTK3 is not an option for me of course, because it has huge buttons and useless on small screens. So meanwhile using Oxygen + GTK2. This happens in all editors I tried (Java, text, gradle), so looks irrelevant to certain editor specifics. Eclipse Java EE IDE for Web Developers. Version: Photon Milestone 4 (4.8.0M4) Build id: 20171214-1849 OS: Linux, v.4.4.0-111-generic, x86_64 / gtk 2.24.24
Created attachment 272530 [details] Screenshot 2
Created attachment 272531 [details] Screenshot 3
Can you please attach your GTK2 version, and your DE/distribution names? Just to be sure, is this still reproducible on 4.8 M5 build? Are you using wayland? Does this also appear in the Console view on scrolling? Movimg to SWT because it is probably styled test related.
Not sure what is DE/destribution names. GTK2: ii libgtk2.0-0:amd64 2.24.24-0ubuntu1~trusty1 amd64 GTK+ graphical user interface library Linux: xubuntu 14.04.5 LTS (Xfce 4.10). Have no Wayland, X11 only. As for console - yes, it also has this bug, didn't notice earlier. After installing Photon M5 (Build id: 20180202-1214), the bug still exists. New screenshot-4 (console view) is from M5. Btw vertical scrolling works Ok, it even fixes the view after corruption by horizontal scrolling (probably because view is just redrawn).
Created attachment 272538 [details] Screenshot 4
Thank you for bug submission. We currently don't fix gtk2 bugs anymore, all our efforts are in fixing any outstanding gtk3 bugs. So while we would perhaps accept a patch, we don't have man-power to investigate the issue ourselves. Maybe we should focus on looking into what's stopping you from moving to gtk3. (We've been using gtk3 for over 2 years ourselves now). If something is stopping you from moving to gtk3, then we should add the issue to: 527444 – (Gtk3ShowStoppers) [GTK3] Umbrella bug for GTK3 showstoppers https://bugs.eclipse.org/bugs/show_bug.cgi?id=527444 Afaik, the big button issue was fixed a while ago. Have you tried with gtk3.22 and recent eclipse? Is it specific to your theme?
Triaging Gtk2-only bugs. Please see Bug 530841 for details. If this bug is not gtk2-specific, please indicate. Thank you for your bug submission.
The main concern as for GTK3 is a toolbar and maybe some related components. To show the difference between gtk2 and gtk3 I created more screenshots. a) Screenshot_gtk2.png - just GTK2. b) Screenshot_gtk2_dark.png - GTK2 with dark theme. c) Screenshot_gtk3.png - just GTK3. d) Screenshot_gtk3_stripped.png - GTK3 with less toolbar buttons (to fit screen width). e) Screenshot_gtk3_stripped_dark.png - GTK3 with less toolbar buttons and dark theme. f) gtk3-widget-factory.png - output of gtk3-widget-factory tool. Explanation: 1) Comparing a) and c) it is obvious even without measuring the toolbar elements are wider in GTK3. The toolbar even don't fit the screen width and shifted to new toolbar line. 2) Comparing a) and d) we see obvious thing - toolbar uses different bg color and looks like imported from other theme. Less obvious - all headers of all views ("Markers", "Project Explorer", "Outline" etc) and also the main toolbar are a couple of pixels higher in GTK3. 2px here, 2px there and in total on small screen you see much less. 3) Comparing b) and e) we see that for GTK2 toolbar is of somewhat its own color, but this color is equal to some bg colors on the screen. For GTK3 toolbar looks completely corrupted, it doesn't follow any theme rules. In general looks like toolbars are rendered with some "engine" completely different from other controls on the screen. While in GTK2 it is almost not noticeable even on exotic themes, in GTK3 it always attracts attention and irritates. The last GTK3 I can test is 3.18.9. But I don't think the version is relevant, because this problem exists for ages. Additionally checked photon-M5 on Windows-8.1, it looks almost the same as on GTK2 in both classic and dark themes. So what should I do next? Create a separate issue for GTK3 or this one is good?
Created attachment 272624 [details] GTK2
Created attachment 272625 [details] GTK2 Dark
Created attachment 272626 [details] GTK3
Created attachment 272627 [details] GTK3 Stripped
Created attachment 272628 [details] GTK3 Stripped Dark
Created attachment 272629 [details] gtk3-widget-factory
(In reply to Ivan Bondarenko from comment #8) Thank you for your feedback. > The main concern as for GTK3 is a toolbar and maybe some related components. > To show the difference between gtk2 and gtk3 I created more screenshots. > a) Screenshot_gtk2.png - just GTK2. > b) Screenshot_gtk2_dark.png - GTK2 with dark theme. > c) Screenshot_gtk3.png - just GTK3. > d) Screenshot_gtk3_stripped.png - GTK3 with less toolbar buttons (to fit > screen width). > e) Screenshot_gtk3_stripped_dark.png - GTK3 with less toolbar buttons and > dark theme. > f) gtk3-widget-factory.png - output of gtk3-widget-factory tool. > > Explanation: > 1) Comparing a) and c) it is obvious even without measuring the toolbar > elements are wider in GTK3. The toolbar even don't fit the screen width and > shifted to new toolbar line. Note, the wide toolbar business has been fixed a while ago: 456345 – [GTK3] Toolbars, Editor tabs, status line way too large https://bugs.eclipse.org/bugs/show_bug.cgi?id=456345 Try latest nightly: http://download.eclipse.org/eclipse/downloads/ > 2) Comparing a) and d) we see obvious thing - toolbar uses different bg > color and looks like imported from other theme. Less obvious - all headers > of all views ("Markers", "Project Explorer", "Outline" etc) and also the > main toolbar are a couple of pixels higher in GTK3. 2px here, 2px there and > in total on small screen you see much less. > 3) Comparing b) and e) we see that for GTK2 toolbar is of somewhat its own > color, but this color is equal to some bg colors on the screen. For GTK3 > toolbar looks completely corrupted, it doesn't follow any theme rules. > > In general looks like toolbars are rendered with some "engine" completely > different from other controls on the screen. While in GTK2 it is almost not > noticeable even on exotic themes, in GTK3 it always attracts attention and > irritates. Eclipse with Darktheme works well with the reference Gnome3/Adwaita-dark implementation. Other gtk3 themes tend to be buggy and there are problems. > > The last GTK3 I can test is 3.18.9. But I don't think the version is > relevant, because this problem exists for ages. Gtk3 version does actually make quite a big difference. There was a big change in theming support starting with gtk3.20 and above. (A separate .css support file for pre3.20 and post.320 is used.). So I would try gtk3.20+, gtk3.22 works best. > Additionally checked photon-M5 on Windows-8.1, it looks almost the same as > on GTK2 in both classic and dark themes. > > So what should I do next? Create a separate issue for GTK3 or this one is > good? Given your situation, my recommendation is as following: *) If you're using gtk3.0 - gtk3.19, consider using white theme if current dark theme is not adequate. *) If you're using gtk3.20 or 3.22, dark theme (with Adwaita) works well. If there are issues, please submit bugs. *) If you're using gtk3.20 - 3.22 with a custom theme & dark theme and it doesn't look well, then it might be a limitation of that particular gtk3 theme as SWT on gtk3 currently uses OS theme colors. In general, anything not related to original bug report is best put into a separate bug/ticket and maybe leave a reference to the old ticket in the new one. Keeping problems in separate bugs makes it easier to keep track of them.
Let me know if you have questions or I can help further.
As for dark theme, I used it only for demonstration. However if I understood you correctly it may be related to Linux's GTK3 theme (either because of GTK3 version or because of CSS configuration). I use one of standard xubuntu themes (Greybird as I remember) with my modifications and looks like toolbars looks different in other themes (Equinox, Bluebird etc). Need some time to experiment here.
(In reply to Ivan Bondarenko from comment #17) > As for dark theme, I used it only for demonstration. > However if I understood you correctly it may be related to Linux's GTK3 > theme (either because of GTK3 version or because of CSS configuration). I > use one of standard xubuntu themes (Greybird as I remember) with my > modifications and looks like toolbars looks different in other themes > (Equinox, Bluebird etc). Need some time to experiment here. Interesting to hear. In my experience, Gtk3.0 - 3.20 is a bit of a roller coaster. However, Gtk3.22 is stable. I expect themes based off of Gtk 3.22's reference theme (Adwaita) will probably function well. But in my experience all the stuff between Gtk3.0-3.20 is a bit of a hit-and miss. Atm I'm using Gnome3/Adwaita, works well. Let me know if I can help further.
Please note: GTK2 support for SWT is being dropped in Eclipse 4.10 / SimRel 2018-12 release. See the following mail for more info: http://dev.eclipse.org/mhonarc/lists/cross-project-issues-dev/msg15783.html
I believe I have found a fix for the original problem that editor redrawn incorrectly on horizontal scrolling. In Canvas.java, scrollInPixels(), there is some code like this: if (Cairo.cairo_version() < Cairo.CAIRO_VERSION_ENCODE(1, 12, 0)) { GDK.gdk_cairo_set_source_window(cairo, window, 0, 0); } else { Cairo.cairo_push_group(cairo); GDK.gdk_cairo_set_source_window(cairo, window, 0, 0); Cairo.cairo_paint(cairo); Cairo.cairo_pop_group_to_source(cairo); } This code was GTK3-only in 4.7.3, and there was some other code for GTK2. However, the GTK2 code is removed in 4.8.0 for some reason I don't know, so eclipse goes through this code even with GTK2 now. Now, we have two code branches to go, depending on cairo version. I believe someone has found the push_group/pop_group approach does not work with cairo<1.12, so we have the version check. But, I found it does not work with GTK2, too, with any version of cairo. Instead, looks like the upper branch - simple gdk_cairo_set_source_window - works just well. So my fix is to choose the upper branch if GTK2: change the code from this if (Cairo.cairo_version() < Cairo.CAIRO_VERSION_ENCODE(1, 12, 0)) { to this if (!GTK.GTK3 || Cairo.cairo_version() < Cairo.CAIRO_VERSION_ENCODE(1, 12, 0)) {
Marking the bug as duplicate of the GTK2 tracker as no work for GTK2 issues will happen. Please reopen if you still face the issue using GTK 3.x. *** This bug has been marked as a duplicate of bug 530841 ***
Ok then. Just want to add that this issue can also be worked around by using cairo 1.11.4.
Could be: if (GTK.GTK_VERSION < OS.VERSION(3, 0, 0) || Cairo.cairo_version() < Cairo.CAIRO_VERSION_ENCODE(1, 12, 0)) { solution to the GTK2 issue as well?
*** Bug 542516 has been marked as a duplicate of this bug. ***