Bug 579405 - [Edge] Redrawing Issue / Flashing when using org.eclipse.swt.Browser with EDGE
Summary: [Edge] Redrawing Issue / Flashing when using org.eclipse.swt.Browser with EDGE
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.21   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 575660
  Show dependency tree
 
Reported: 2022-03-24 08:13 EDT by Steffen Vogel CLA
Modified: 2022-08-02 06:46 EDT (History)
5 users (show)

See Also:


Attachments
Video shows the behaviour of the issue and how it can be triggered. (2.06 MB, video/mp4)
2022-03-24 09:39 EDT, Steffen Vogel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Vogel CLA 2022-03-24 08:13:52 EDT
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.
Comment 1 Phil Beauvoir CLA 2022-03-24 09:27:55 EDT
Yes, I see this with our RCP app which uses an embedded Edge browser.
Comment 2 Steffen Vogel CLA 2022-03-24 09:39:43 EDT
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.
Comment 3 Kent Xu CLA 2022-07-06 07:29:05 EDT
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.
Comment 4 Lee Yong Jo CLA 2022-08-02 06:46:14 EDT
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();
  }
 }
});