Bug 201261 - [Display] Support Resize-Listener
Summary: [Display] Support Resize-Listener
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 2.1 M2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: protocol
Keywords:
: 390399 (view as bug list)
Depends on: 402514
Blocks: 262787
  Show dependency tree
 
Reported: 2007-08-27 10:43 EDT by Rüdiger Herrmann CLA
Modified: 2013-04-09 04:26 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rüdiger Herrmann CLA 2007-08-27 10:43:05 EDT
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.
Comment 1 Rüdiger Herrmann CLA 2010-02-05 09:43:24 EST
In the meanwhile, add/removeListener exists on Display.
Resize events on display don't seem to make much sense.
Comment 2 Michal Tkacz CLA 2010-08-26 06:55:09 EDT
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?
Comment 3 Rüdiger Herrmann CLA 2010-08-26 17:46:01 EDT
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.
Comment 4 Stefan Milchram CLA 2013-02-21 06:51:46 EST
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
Comment 5 Ivan Furnadjiev CLA 2013-02-21 06:56:29 EST
I will reopen this bug as Tabris native clients (android and iOS) also will benefit from it.
Comment 6 Ralf Sternberg CLA 2013-03-14 05:10:39 EDT
*** Bug 390399 has been marked as a duplicate of this bug. ***
Comment 7 Ivan Furnadjiev CLA 2013-04-09 04:18:15 EDT
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.
Comment 8 Ivan Furnadjiev CLA 2013-04-09 04:26:17 EDT
Just for the record: Added in protocol listen/notify operations for display Resize.