Community
Participate
Working Groups
Provide add/removeListener API on calss Display Replace the preliminary maximize behavior of shells with a resize-event-listener that adjusts the shell-bounds to the display-bounds.
In the meanwhile, add/removeListener exists on Display. Resize events on display don't seem to make much sense.
If resize events on display don't make sense, then how can I handle a situation in which the size of a browser window has changed? Is there a separate API for this?
I am uncertain if SWT provides resize-listeners for Display. If there are no resize-listeners in SWT, this would put any discussion to an end. However, I can't really recall what led to the statement that resize-listeners on Display don't make sense, so if you have a decent use-case, please feel free to reopen.
SWT does not support resize events on Display. Checked this through registering an untyped listener via Display.addListener(...) and changed the desktop-resolution. Although RWT should support this because: 1) If you implement a application using more shells which can be arranged by the user you need the resize-listener to implement correct resizing behaviour 2) Putting a shell in the background is not always an option, as it is tricky to make the shell a "real" background (so that it is not focusable and does stay in the background). We tried this making the background shell the parent of the foreground-shell and made them application modal. This isn't very good because you have are locked to the threading model supporting this and it isn't possible when using Workbench because the org.eclipse.ui.PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) method only takes a display and creates the necessary shells on its own. 3) We thought about registering some custom scriptcode containing "window.onresize( //start clientnsync here //set flag in customobject to get a handler notified )" But we would also have to implement a custom object (we would use the new API introduced in 2.0) to get a java-method called where we could process the changes. We didn't test this yet, its just an idea. 4) RWT should provide more features than SWT and evolve beyound the idea of single-sourcing
I will reopen this bug as Tabris native clients (android and iOS) also will benefit from it.
*** Bug 390399 has been marked as a duplicate of this bug. ***
After some discussions with SWT team there are positive indications to support SWT.Resize event on Display. See: - bug 402514 - http://dev.eclipse.org/mhonarc/lists/platform-swt-dev/msg07513.html In RAP the support for display Resize event is added with commit 21624ba94fa90736576ee8cc97e823bd71034db0.
Just for the record: Added in protocol listen/notify operations for display Resize.