eclipse-platform / eclipse.platform.swt

Eclipse SWT
https://www.eclipse.org/swt/
Eclipse Public License 2.0
118 stars 139 forks source link

Ruffle Emulation (WebAssembly, HTML5) Fails in Integrated SWT Browser on M1/M2/M3 Macs Post-Sonoma Update #1210

Open andrinziegler opened 6 months ago

andrinziegler commented 6 months ago

Describe the bug In the Eclipse RCP integrated browser, we utilize Ruffle to emulate Flash content. However, we have encountered an issue on Mac computers equipped with M1, M2, or M3 chips where Ruffle ceases to function within the integrated SWT browser following an update to Sonoma. Notably, Ruffle continues to operate successfully in the standalone version of Safari, indicating that the problem is specific to the integration within the SWT-Safari environment.

What is Ruffle Ruffle is an open-source emulator designed to play Adobe Flash content, using WebAssembly and HTML5 technologies instead of the now-deprecated Flash plugin. As Flash was widely used for multimedia applications, games, and interactive content on the web, Ruffle serves as an important tool for preserving this type of content on modern web browsers without needing the original Flash plugin, which is no longer supported or secure to use. (ruffle.rs)

To Reproduce

  1. Open the Eclipse Internal Web Browser with the latest Safari (Sonoma 17.4)

Screenshot 2024-05-03 at 14 32 29

  1. Open the ruffle.rs website with the demo: https://ruffle.rs/demo/
Bildschirmfoto 2024-05-03 um 14 32 26
  1. As you can see the .swf-File is deformed and not working properly

Expected behavior If you open the same webpage in Safari, outside of the SWT-Browser:

Bildschirmfoto 2024-05-03 um 14 33 10

The SWF is properly displayed.

Environment:

  1. Select the platform(s) on which the behavior is seen:
      • [ ] Windows
      • [ ] Linux
      • [x] macOS, Sonoma, M1, M2, M3

Version since Eclipse or SWT version since when the behavior is seen: Eclipse 2024-03

Phillipus commented 6 months ago

I tried it on my setup and it renders OK:

MacBook Air 15" M2 macOS Sonoma 14.4.1 Safari version 17.4.1 (19618.1.15.11.14) Eclipse 4.31 and 4.32 latest I-build

import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class SWTBrowserTest {

    public static void main(String[] args) {
        final Display display = new Display();

        final Shell shell = new Shell(display);
        shell.setText("SWT Browser");
        shell.setLayout(new FillLayout());
        shell.setSize(1024, 768);

        Browser browser = new Browser(shell, SWT.NONE);
        browser.setUrl("https://ruffle.rs/demo/");

        shell.open();

        while(!shell.isDisposed()) {
            if(!display.readAndDispatch()) {
                display.sleep();
            }
        }

        display.dispose();
    }
}
Screenshot 2024-05-03 at 15 11 54
andrinziegler commented 6 months ago

Thanks for checking.

It seems like the issue is only with the x86 build of Eclipse; the AArch64 build is working fine. To keep things moving, we're thinking of switching to building for AArch64 instead. Before we make the switch, though we would like to know why x86 is causing trouble.

Phillipus commented 6 months ago

It seems like the issue is only with the x86 build of Eclipse

I can confirm that. Using the same machine as in my previous post I set the target SWT platform to x86_64 and the same for the JDK and I saw the artefacts in your first screenshot. However, it's OK on macOS Ventura x86_64, so it must be something in the combination of Sonoma and x86_64.