Bug 426694 - [GTK3] Scrolling in the Java editor created black area with GTK3
Summary: [GTK3] Scrolling in the Java editor created black area with GTK3
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.4   Edit
Hardware: PC Linux
: P3 major with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 469027 470276 (view as bug list)
Depends on:
Blocks: 340067
  Show dependency tree
 
Reported: 2014-01-27 05:04 EST by Lars Vogel CLA
Modified: 2017-12-14 18:45 EST (History)
18 users (show)

See Also:


Attachments
Screenshot (245.80 KB, image/png)
2014-01-27 05:05 EST, Lars Vogel CLA
no flags Details
garbed text (bottom line repeated) (121.44 KB, image/png)
2014-06-03 22:27 EDT, Kent Tong CLA
no flags Details
Screenshot on Fedora 21 (234.93 KB, image/png)
2014-12-27 22:16 EST, Changming Sun CLA
no flags Details
Eclipse window screenshot with black area inside JavaScript file editor (68.38 KB, image/png)
2015-07-28 03:57 EDT, Alfred Brown CLA
no flags Details
Linux Mint 17 (106.04 KB, image/png)
2015-11-06 05:12 EST, Raúl García CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2014-01-27 05:04:42 EST
If I scroll in the Java editor I see blank lines, see attached screenhshot. This is might be a duplicate of Bug 392700, but this bug is marked as fixed.

You can use the same test case to validated that. I'm using Ubuntu 13.04.

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;

public class ScrollTest {
	public static void main(String[] args) {
		Display display = new Display();
		Shell shell = new Shell(display);

		final Canvas canvas = new Canvas(shell, SWT.NONE);
		canvas.setBounds(10, 10, 300, 300);

		final Color[] colors = new Color[] {
				display.getSystemColor(SWT.COLOR_RED),
				display.getSystemColor(SWT.COLOR_CYAN),
				display.getSystemColor(SWT.COLOR_GREEN),
				display.getSystemColor(SWT.COLOR_YELLOW),
				display.getSystemColor(SWT.COLOR_MAGENTA) };
		canvas.addListener(SWT.Paint, new Listener() {
			int i;

			public void handleEvent(Event event) {
				GC gc = event.gc;
				gc.setBackground(colors[i++ % colors.length]);
				gc.fillRectangle(-100, -100, 2000, 2000);
				gc.drawLine(event.x, event.y, event.x + event.width - 1,
						event.y + event.height - 1);
			}
		});

		canvas.addListener(SWT.MouseDown, new Listener() {
			public void handleEvent(Event event) {
				// DOWN
				// canvas.scroll(0, 17, 0, 0, 300, 300, true);

				// UP
				// canvas.scroll(0, 0, 0, 17, 300, 300, true);

				// ENTER
				canvas.scroll(0, 117, 0, 100, 300, 300, true);
			}
		});

		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		display.dispose();
	}
}
Comment 1 Lars Vogel CLA 2014-01-27 05:05:05 EST
Created attachment 239333 [details]
Screenshot
Comment 2 Lars Vogel CLA 2014-01-27 05:07:13 EST
In the Java editor I need to scroll with the mouse, "scrolling" with the keyboard works fine.
Comment 3 Lars Vogel CLA 2014-02-17 07:29:06 EST
Increasing the prio, tried to work with it, but this makes the source code editor really hard to use.
Comment 4 Stephan Herrmann CLA 2014-03-25 16:13:24 EDT
I recently observed kind-of the inverse:

when scrolling by keyboard cursor up / down only a few line where updated, the bigger part of the editor kept showing stale content. For me wheel or scrollbar scrolling works OK.

Could that possibly have the same root cause, or should I file a new bug.

Unfortunately, right now I cannot reproduce so I cannot show a screenshot. I'll keep an eye on it.

(FWIW: I'm on Kubuntu 13.10)
Comment 5 Niraj Modi CLA 2014-03-27 05:09:37 EDT
In Java Editor I didn't notice this issue while scrolling with mouse/keyboard.
Tested on Ubuntu13.10 as well as Kubuntu13.10
Comment 6 Lars Vogel CLA 2014-03-27 05:21:17 EDT
(In reply to Niraj Modi from comment #5)
> In Java Editor I didn't notice this issue while scrolling with
> mouse/keyboard.
> Tested on Ubuntu13.10 as well as Kubuntu13.10

Are you using GTK3? IIRC the new default is to use GTK2.
Comment 7 Niraj Modi CLA 2014-03-27 05:26:35 EDT
(In reply to Lars Vogel from comment #6)
> (In reply to Niraj Modi from comment #5)
> > In Java Editor I didn't notice this issue while scrolling with
> > mouse/keyboard.
> > Tested on Ubuntu13.10 as well as Kubuntu13.10
> 
> Are you using GTK3? IIRC the new default is to use GTK2.

Yes, I am using GTK3.
Comment 8 Arun Thondapu CLA 2014-03-27 05:51:24 EDT
(In reply to Lars Vogel from comment #6)
> (In reply to Niraj Modi from comment #5)
> > In Java Editor I didn't notice this issue while scrolling with
> > mouse/keyboard.
> > Tested on Ubuntu13.10 as well as Kubuntu13.10
> 
> Are you using GTK3? IIRC the new default is to use GTK2.

The fall back to GTK2 happens when the GTK3 version is >= 3.9.0 but both Ubuntu 13.10 and Kubuntu 13.10 have GTK 3.8.6 installed. So, the default will still be GTK3 on these machines.
Comment 9 Alexander Kurtakov CLA 2014-04-03 17:08:26 EDT
Interesting bug. Let's try to understand what's wrong. Lars, would you please attach a gtk2 and gtk3  screenshots from your machine (gtk 3.8 or 3.10?) so I can verify I see same problem.
Comment 10 Alexander Kurtakov CLA 2014-04-03 17:18:08 EDT
I think that this snippet should have entirely different behaviour on 3.8 and 3.10 and that what I see on 3.10 is related to Bug 421127 .
Comment 11 Snjezana Peco CLA 2014-04-14 13:09:25 EDT
The issue is related to the overlay scrollbars that are enabled on Ubuntu by default.
You can disable them using:

export LIBOVERLAY_SCROLLBAR=0

or

gsettings set com.canonical.desktop.interface scrollbar-mode normal

if you want to disable them globally.
Comment 12 Kent Tong CLA 2014-06-03 22:26:38 EDT
I am also seeing this on Ubuntu 13.10 64bit (no problem on 32bit). setting LIBOVERLAY_SCROLLBAR=0 doesn't fix the bug (the scrollbar is there constantly, so the setting is working for this intended purpose).

Scrolling with the mouse wheel works fine, but scrolling with the keyboard and the scrollbar doesn't: the text is garbled (usually the line at the bottom of the window is repeated).

Scrolling upward but fine. The problem happens only when scrolling downward.
Comment 13 Kent Tong CLA 2014-06-03 22:27:24 EDT
Created attachment 243910 [details]
garbed text (bottom line repeated)

Please see the attachment for the screenshot
Comment 14 Kent Tong CLA 2014-06-03 22:28:18 EDT
I meant scrolling upward *works* fine
Comment 15 chance harris CLA 2014-09-10 22:31:53 EDT
This is happening to me too.

One more workaround : maximize your eclipse, and/or width. If I just make any window where this is happening as wide as possible black area disappears.

I think there are two seperate bugs happening here. I'm just seeing black area on the right, when I scroll up or down with mouse wheel or with keyboard. I don't think it's java-editor specific. Happens in a java file, a pom file, a .txt file, and in Preferences->Java->Code Style->Formatter if you scroll in the text screen. I think the garbeled text that some are reporting is a different thing altogether. Of course I might be wrong.

Whether ot not in happens in Preferences->Java->Code Style->Formatter is very flaky. It has something to do with if main eclipse is maximized or not.

LIBOVERLAY_SCROLLBAR didn't do squat.

If anyone wants to know what version of what I've got. please ask.
Comment 16 chance harris CLA 2014-09-11 00:02:53 EDT
even better workaround:

set this in the environment (to a blank/empty/nothing value).

UBUNTU_MENUPROXY

you still get a black rectangle, but it's one column wide now. so it's goofy looking, but it doesn't make text editing impossible.

still goes away if you maximize eclipse window.
Comment 17 chance harris CLA 2014-09-11 00:44:20 EDT
one final update. I'm working good now with all 3 of these set:

setenv UBUNTU_MENUPROXY
setenv LIBOVERLAY_SCROLLBAR
setenv SWT_GTK3

(I use tcsh, sorry translate to bash as you will).

Supposefely with Ubuntu 14.something, this isn't needed any more, but I don't feel like upgrading that right now. (I'm running Mint 16, which I think is about the same as Ubuntu 13.10, but don't hold me to that).

And I don't really know if all three are needed, or what the exact necessary/sufficient combos are, but this is working for me. good luck.
Comment 18 Kent Tong CLA 2014-09-11 00:47:58 EDT
my problem was fixed by upgrading to Ubuntu 14.
Comment 19 Lars Vogel CLA 2014-12-17 14:24:07 EST
I haven't see that in Build id: N20141214-2000 so I mark it as fixed.
Comment 20 Changming Sun CLA 2014-12-27 22:16:03 EST
Created attachment 249637 [details]
Screenshot on Fedora 21

Screenshot on Fedora 21 ,eclipse 4.5M4.
Comment 21 Alfred Brown CLA 2015-07-28 03:55:29 EDT
Sorry, but this bug remains unresolved for me (see image "2015-07-28-093724_1024x768_scrot.png" attached).
This is my configuration:

My Linux version (Ubuntu 15 64 bits):
	ime@mypc:/tmp$ cat /etc/issue
	Ubuntu 15.04 \n \l
	ime@mypc:/tmp$ cat /proc/version
	Linux version 3.19.0-25-generic (buildd@lgw01-07) (gcc version 4.9.2 (Ubuntu 4.9.2-10ubuntu13) ) #26-Ubuntu SMP Fri Jul 24 21:17:31 UTC 2015
	ime@mypc:/tmp$ uname -a
	Linux mypc 3.19.0-25-generic #26-Ubuntu SMP Fri Jul 24 21:17:31 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
My Eclipse version (Mars):
	Eclipse Java EE IDE for Web Developers.
	Version: Mars Release (4.5.0)
	Build id: 20150621-1200
My GTK version:
	ime@mypc:/tmp$ dpkg -l libgtk* | grep -e '^i' | grep -e 'libgtk-*[0-9]'
	ii  libgtk-3-0:amd64             3.14.13-0ubuntu1   amd64        GTK+ graphical user interface library
	ii  libgtk-3-bin                 3.14.13-0ubuntu1   amd64        programs for the GTK+ graphical user interface library
	ii  libgtk-3-common              3.14.13-0ubuntu1   all          common files for the GTK+ graphical user interface library
	ii  libgtk2-perl                 2:1.2492-4         amd64        Perl interface to the 2.x series of the Gimp Toolkit library
	ii  libgtk2.0-0:amd64            2.24.27-0ubuntu1   amd64        GTK+ graphical user interface library
	ii  libgtk2.0-common             2.24.27-0ubuntu1   all          common files for the GTK+ graphical user interface library
	ime@mypc:/tmp$ dpkg -s libgtk2.0-0|grep '^Version'
	Version: 2.24.27-0ubuntu1
Comment 22 Alfred Brown CLA 2015-07-28 03:57:14 EDT
Created attachment 255469 [details]
Eclipse window screenshot with black area inside JavaScript file editor
Comment 23 Lars Vogel CLA 2015-07-28 09:46:51 EDT
(In reply to Alfred Brown from comment #21)
> Sorry, but this bug remains unresolved for me (see image
> "2015-07-28-093724_1024x768_scrot.png" attached).

IIRC we are working on the remaining issue in Bug 465054.
Comment 24 Raúl García CLA 2015-11-06 05:04:18 EST
I can see that this bug is marked as resolved/fixed and that is VERY far for true. This critical bug has been going on for a VERY long while, making Eclipse completely unusable.

What is your recommendation? Moving back to OS's 3.8.1 version? Netbeans? I just cannot do anything if I can't even see the source code.
Comment 25 Raúl García CLA 2015-11-06 05:12:49 EST
Created attachment 257777 [details]
Linux Mint 17
Comment 26 Raúl García CLA 2015-11-06 05:17:40 EST
Sorry for multiple posts. I intended to add it all on only one post (please join them all if possible). This is my config:

Eclipse Java EE IDE for Web Developers.

Version: Mars.1 Release (4.5.1)
Build id: 20150924-1200


rgarcia@goayr:~ > cat /etc/issue
Linux Mint 17.2 Rafaela \n \l
rgarcia@goayr:~ > cat /proc/version
Linux version 3.16.0-38-generic (buildd@allspice) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) ) #52~14.04.1-Ubuntu SMP Fri May 8 09:43:57 UTC 2015
rgarcia@goayr:~ > uname -a
Linux goayr 3.16.0-38-generic #52~14.04.1-Ubuntu SMP Fri May 8 09:43:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
rgarcia@goayr:~ > dpkg -l libgtk* | grep -e '^i' | grep -e 'libgtk-*[0-9]'
ii  libgtk-3-0:amd64                                            3.10.8~8+qiana                                      amd64        GTK+ graphical user interface library
ii  libgtk-3-bin                                                3.10.8~8+qiana                                      amd64        programs for the GTK+ graphical user interface library
ii  libgtk-3-common                                             3.10.8~8+qiana                                      all          common files for the GTK+ graphical user interface library
ii  libgtk2-gladexml-perl                                       1.007-1build3                                       amd64        Perl interface to use user interfaces created with glade-2
ii  libgtk2-perl                                                2:1.249-2                                           amd64        Perl interface to the 2.x series of the Gimp Toolkit library
ii  libgtk2.0-0:amd64                                           2.24.23-0ubuntu1.3                                  amd64        GTK+ graphical user interface library
ii  libgtk2.0-0:i386                                            2.24.23-0ubuntu1.3                                  i386         GTK+ graphical user interface library
ii  libgtk2.0-bin                                               2.24.23-0ubuntu1.3                                  amd64        programs for the GTK+ graphical user interface library
ii  libgtk2.0-cil                                               2.12.10-5                                           amd64        CLI binding for the GTK+ toolkit 2.12
ii  libgtk2.0-common                                            2.24.23-0ubuntu1.3                                  all          common files for the GTK+ graphical user interface library
ii  libgtk2.0-dev                                               2.24.23-0ubuntu1.3                                  amd64        development files for the GTK+ library
rgarcia@goayr:~ > dpkg -s libgtk2.0-0|grep '^Version'
Version: 2.24.23-0ubuntu1.3
Comment 27 Holger Teickner CLA 2015-12-22 15:18:57 EST
I solved this problem with editing the ecilpse.ini in this way:

I added the following lines:
--launcher.GTK_version
2

after
-vm
/usr/lib/jvm/java-8-oracle/jre/bin


--launcher.GTK_version
2

and befor this:

-vmargs


regards
Comment 28 Raúl García CLA 2016-01-20 04:43:43 EST
After months seeing a black screen instead of my code (I dare you to try it for just one week) and using old versions of Eclipse, I finally managed to 'fix' it. It's not a fix, it's just a trick to keep working while that black screen is fixed.

The idea is simple: Eclipse GTK3 is broken, so force GTK2. I created a shell file with these commands:

export SWT_GTK3=0
eclipse
Comment 29 Lars Vogel CLA 2016-01-20 05:00:34 EST
(In reply to Raúl García from comment #28)
> After months seeing a black screen instead of my code (I dare you to try it
> for just one week) and using old versions of Eclipse, I finally managed to
> 'fix' it. It's not a fix, it's just a trick to keep working while that black
> screen is fixed.

Works fine for me in Eclipse Neon with GTK3. Try the latest I-Build from http://download.eclipse.org/eclipse/downloads
Comment 30 Raúl García CLA 2016-01-20 06:17:44 EST
(In reply to Lars Vogel from comment #29)
> (In reply to Raúl García from comment #28)
> > After months seeing a black screen instead of my code (I dare you to try it
> > for just one week) and using old versions of Eclipse, I finally managed to
> > 'fix' it. It's not a fix, it's just a trick to keep working while that black
> > screen is fixed.
> 
> Works fine for me in Eclipse Neon with GTK3. Try the latest I-Build from
> http://download.eclipse.org/eclipse/downloads

It's more complicated than that. The Eclipse team decided to leave old code that is used by some plugins that breaks the environment as seen in the screenshots. As soon as you use one of those plugins you are done. Funny thing is that that old functionality doesn't work with Java8 and has given me issues in the past using Windows.

While this problem exists, installing from the Eclipse Marketplace is like Russian roulette.

I do not know plugins break your eclipse but you can see an example if you install for example Spring tools suite from the marketplace or if you download Eclipse with it included from this url: http://spring.io/tools/sts/all

Right now I'm seeing this issue using Eclipse 4.5.1
Comment 31 Lars Vogel CLA 2016-01-20 08:31:38 EST
(In reply to Raúl García from comment #30)
> Right now I'm seeing this issue using Eclipse 4.5.1

I suggested to try the latest integration build Eclipse 4.6 in Comment 29. Some of the most critical fixes for this will be in 4.5.2.
Comment 32 Raúl García CLA 2016-03-23 05:10:14 EDT
(In reply to Lars Vogel Unavailable until 21.03.2016 from comment #31)
> (In reply to Raúl García from comment #30)
> > Right now I'm seeing this issue using Eclipse 4.5.1
> 
> I suggested to try the latest integration build Eclipse 4.6 in Comment 29.
> Some of the most critical fixes for this will be in 4.5.2.

I still have black screen in 4.5.2 (Mars.2) if I use GTK3. Will test 4.6 as soon as it's out.
Comment 33 Karsten Burger CLA 2016-04-05 05:12:05 EDT
Hello, I still experience the seemingly similar problem using the CDT for C++ editing. It happens with mouse whell and line-up/down keys. PageUp or Down helps.
export SWT_GTK3=0 did not help, but crashed very soon with 

java: /builddir/build/BUILD/oxygen-gtk2-1.3.4/src/animations/oxygencomboboxdata.cpp:87: void Oxygen::ComboBoxData::setButton(GtkWidget*): Assertion "!_button._widget" failed.

Eclipse version: 
Version: Mars.2 Release (4.5.2)
Build id: 20160218-0600

Computer: CentOS 7
Linux 3.10.0-327.10.1.el7.x86_64 #1 SMP Tue Feb 16 17:03:50 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Really disturbing bug.
Comment 34 Karsten Burger CLA 2016-04-05 05:18:13 EDT
Sorry: "Whell" --> wheel.
also scroll bar has same problem.

PageUp or Down only helps for those screen regions which are out of the window and are redrawn back in, not for the whole black rect.
Comment 35 Marc-André Laperle CLA 2016-04-05 10:59:59 EDT
(In reply to Karsten Burger from comment #33)
> java:
> /builddir/build/BUILD/oxygen-gtk2-1.3.4/src/animations/oxygencomboboxdata.
> cpp:87: void Oxygen::ComboBoxData::setButton(GtkWidget*): Assertion
> "!_button._widget" failed.

There is a known bug in oxygen-gtk2. You can change the theme to work around the issue.
Comment 36 Karsten Burger CLA 2016-04-05 12:32:52 EDT
(In reply to Marc-Andre Laperle from comment #35)
> (In reply to Karsten Burger from comment #33)
> > java:
> > /builddir/build/BUILD/oxygen-gtk2-1.3.4/src/animations/oxygencomboboxdata.
> > cpp:87: void Oxygen::ComboBoxData::setButton(GtkWidget*): Assertion
> > "!_button._widget" failed.
> 
> There is a known bug in oxygen-gtk2. You can change the theme to work around
> the issue.

Thanks a lot, at the moment it only seems to happen when I open "Eclipse Marketplace".
Comment 37 Karsten Burger CLA 2016-04-06 11:21:42 EDT
Hello, I added
        --launcher.GTK_version
        2
in my /opt/eclipse/eclipse.ini config file, instead of using the environment variable mentioned above. 

However, Eclipse also crashes when I open the Team > Commit  dialog, not only when opening Marketplace as I said above.

I vote for reopening the bug, it is really annoying.
Comment 38 Lars Vogel CLA 2016-04-06 11:25:17 EDT
(In reply to Karsten Burger from comment #37)
> However, Eclipse also crashes when I open the Team > Commit  dialog, not
> only when opening Marketplace as I said above.

Crashing is very different from creating a black area with GTK3 and should be handled by another bug.
Comment 39 Karsten Burger CLA 2016-04-06 11:53:19 EDT
(In reply to Lars Vogel from comment #38)
> (In reply to Karsten Burger from comment #37)
> > However, Eclipse also crashes when I open the Team > Commit  dialog, not
> > only when opening Marketplace as I said above.
> 
> Crashing is very different from creating a black area with GTK3 and should
> be handled by another bug.

Hello Lars,
yes, true. I only wanted to point out, that for me there is no good workaround at the moment.

I played around and chose different window decoration themes, as someone suggested, but except for the horizontal size of the upper window border nothing changed, and it reliably crashes when opening an "Eclipse Marketplace" or "contex Menu > Team > Commit" dialog.
Comment 40 Karsten Burger CLA 2016-04-06 11:54:39 EDT
I found this open bug which seems to describe a similar problem: 

Bug 469027 - [GTK3] Rendering problems on scrolling
Comment 41 Karsten Burger CLA 2016-04-07 10:42:33 EDT
Also crashes when opening Project > Properties
Comment 42 Marc-André Laperle CLA 2016-04-07 10:46:54 EDT
(In reply to Karsten Burger from comment #41)
> Also crashes when opening Project > Properties

Could you create a separate bug? This bug is not about crashes.
Comment 43 Lars Vogel CLA 2016-04-07 10:58:01 EDT
*** Bug 469027 has been marked as a duplicate of this bug. ***
Comment 44 Karsten Burger CLA 2016-04-08 09:09:51 EDT
(In reply to Marc-Andre Laperle from comment #35)
> (In reply to Karsten Burger from comment #33)
> > java:
> > /builddir/build/BUILD/oxygen-gtk2-1.3.4/src/animations/oxygencomboboxdata.
> > cpp:87: void Oxygen::ComboBoxData::setButton(GtkWidget*): Assertion
> > "!_button._widget" failed.
> 
> There is a known bug in oxygen-gtk2. You can change the theme to work around
> the issue.

Hello Marc-Andre, do you perhaps have a link to the bug description?  Thanks.
Comment 45 Marc-André Laperle CLA 2016-04-08 10:53:33 EDT
(In reply to Karsten Burger from comment #44)
> (In reply to Marc-Andre Laperle from comment #35)
> > (In reply to Karsten Burger from comment #33)
> > > java:
> > > /builddir/build/BUILD/oxygen-gtk2-1.3.4/src/animations/oxygencomboboxdata.
> > > cpp:87: void Oxygen::ComboBoxData::setButton(GtkWidget*): Assertion
> > > "!_button._widget" failed.
> > 
> > There is a known bug in oxygen-gtk2. You can change the theme to work around
> > the issue.
> 
> Hello Marc-Andre, do you perhaps have a link to the bug description?  Thanks.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=440660#c20
and https://bugs.kde.org/show_bug.cgi?id=339174
Comment 46 Alexander Kurtakov CLA 2017-12-14 18:45:43 EST
*** Bug 470276 has been marked as a duplicate of this bug. ***