Summary: | [Edge] Redrawing Issue / Flashing when using org.eclipse.swt.Browser with EDGE | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Steffen Vogel <steffen.vogel> | ||||
Component: | SWT | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> | ||||
Status: | NEW --- | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | kentxu2007, nikita, niraj.modi, p.beauvoir, yj92133581 | ||||
Version: | 4.21 | ||||||
Target Milestone: | --- | ||||||
Hardware: | PC | ||||||
OS: | Windows 10 | ||||||
Whiteboard: | |||||||
Bug Depends on: | |||||||
Bug Blocks: | 575660 | ||||||
Attachments: |
|
Description
Steffen Vogel
2022-03-24 08:13:52 EDT
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(); } } }); |