Community
Participate
Working Groups
When the org.eclipse.swt.Browser Component is created with SWT Styleflag SWT.EDGE the component flashes / flickers if it is used inside a Part of an Eclipse RCP application and the size of this Part is adjusted. Inside the area where the webcontent is/would be displayed Parts of the applications User Interfaces can be seen. This behaviour seems only to occur when org.eclipse.swt.Browser is created with the SWT.EDGE Style, i don't see it happen e.g when using SWT.NONE and Internet Explorer is used.
Yes, I see this with our RCP app which uses an embedded Edge browser.
Created attachment 288286 [details] Video shows the behaviour of the issue and how it can be triggered. I added a video which shows this issue inside an Eclipse-RCP Application.
We ran into a similar problem. This only happens when the browser is running in Edge mode. It is likely an SWT Edge implementation issue. It seems that the size change requests to the Browser is more intensive in this case. Depending on the layout, the Browser widget may receive tons of resize requests when you change the size of the view, and that grinds the entire UI system to a halt. One workaround is to reduce the amount of size changes to the Browser, e.g. only refresh Browser size once per second.
I don't think this bug is fixed yet. The code below is not good, but it will be better than flickering. I use it like this temporarily until the improved version comes out. Browser browser = new Browser(parent, SWT.EDGE); AtomicBoolean flag = new AtomicBoolean(true); AtomicLong time = new AtomicLong(0); browser.addListener(SWT.Resize, new Listener() { @Override public void handleEvent(Event event) { time.set(System.currentTimeMillis()); if (flag.get()) { flag.set(false); browser.setVisible(false); new Thread() { public void run() { while (System.currentTimeMillis() - time.get() <= 100) { //do nothing } Display.getDefault().syncExec(() -> { browser.setVisible(true); }); flag.set(true); } }.start(); } } });