Project: SWT
Bug 46543 [browser] Photon / Investigate/Provide support for NewWindow event
Reported: 2003-11-12 17:52:08 | Status: closed wontfix

Provide support for the test case in the attachement below - unzip - open the document index.html - click on links. The Browser widget should correctly handle the new window requests in those 2 cases. Current approach is to provide the following event (names not finalized yet, to give an idea): public class NewWindow ... { /** user provides the Browser instance that is to host the new window - null: cancel new window request */ public Browser browser; } And 2 events fired when the Browser is requested to change its location and/or size: public class MoveControlEvent { int x; int y; } public class ResizeControlEvent { int width; int height; } Typically, in response to javascript window.open ("dialog.html","Dialog", "resizeable=no,height=200,left=50,top=400", the application will receive a NewWindow event. It will create a new Shell and a new Browser. The new Browser will display the file 'dialog.html' and receive the events ResizeControlEvent and MoveControlEvent to give a chance to the application to resize the new Shell and the new Browser to the bounds set in javascript. Please let us know if the API on Photon would support that approach.

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT Browser/photon/org/eclipse/swt/browser/Browser.java bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/OS.java bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PtWebWindowCallback_t.java