Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[albireo-dev] [platform-swt-dev] SWT_AWT bridge enhancements for dual-process approaches

My message bounced back as I had to register to the list...

---------- Forwarded message ----------
From: Christopher Deckers <chrriis@xxxxxxxxx>
Date: Tue, Mar 4, 2008 at 6:29 PM
Subject: Re: [platform-swt-dev] SWT_AWT bridge enhancements for
dual-process approaches
To: "Eclipse Platform SWT component developers list."
<platform-swt-dev@xxxxxxxxxxx>
Cc: Albireo Developer List <albireo-dev@xxxxxxxxxxx>


Hi Gordon,


 >  The cross-process embedding idea is interesting. Is there any reason why
 >  it could not apply to the case where SWT embeds Swing?

 In fact it could apply to SWT embedding Swing. I just didn't have that
 in mind. So let's add the 2 counterpart methods in the proposed API:


 SWT_AWT
  public static HandleData getHandleData(Canvas c) {}
  public static Shell newShell(Display display, HandleData parentHandleData) {}
  public static HandleData getHandleData(Composite c) {}
  public static Frame newFrame(HandleData parentHandleData) {}


 HandleData implements Serializable
  int /* long */ handle;


>  I can see some benefit especially if the embedded component is very
 >  self-contained and there is very little (programmatic) interface needed
 >  between it and components from the other toolkit. Is that the case for
 >  you, Christopher? Or are you layering some sort of IPC on top of this to
 >  communicate back and forth?

 I have IPC on top: I have a full messaging system in place, and since
 it is Java to Java communication I send serialized commands. I also
 have the notion of sync calls, where it waits for a result but still
 processes incoming messages (which themselves can be sync calls,
 etc.).
 It works really well, and it is the new architecture of my next
 release of DJ NativeSwing project. For more details, please contact me
 by e-mail as I don't think it is appropriate to spam this list (I can
 even send you a preview version if you want to play with it and look
 at the code).


 >  I'd be interested to hear more specifics about the in-process problems
 >  you've been seeing. If the embedded component is relatively
 >  self-contained, I'd expect fewer problems (but not 0 problems :-).

 The major problems I had were mainly on Linux, mostly when I embed a
 Browser with a plugin inside. Some plugins + SWT + AWT/Swing result in
 weird behaviors. A simple test case is to embed the VLC player in a
 browser, and open a JFileChooser while a video is playing. When you
 close the file chooser, the JVM crashes 99% of the time. I also had
 instability issues (freezes) when embedding a Flash component.
 All those problems are gone with my dual-process approach, and it
 simplifies threading between the two toolkits.

 I don't have a Mac, but I wonder if embedding SWT in Swing would work
 using a dual-process approach...

 Cheers,
 -Christopher


Back to the top