Bug 402514 - Add support for display resize listener
Summary: Add support for display resize listener
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.2   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 201261
  Show dependency tree
 
Reported: 2013-03-06 05:47 EST by Ivan Furnadjiev CLA
Modified: 2014-12-17 15:26 EST (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 Ivan Furnadjiev CLA 2013-03-06 05:47:29 EST
Currently, its possible to attach an untyped Resize listener to display, but it is never notified. In the JavaDoc of SWT.Resize constant the Display#addListener is not mentioned as well. I think that resizing the display is valid when you change the resolution.
Comment 1 Randy Hudson CLA 2013-03-14 11:03:24 EDT
I think that Display fires the multi-purpose "Settings" event when the resolution changes.
Comment 2 Ralf Sternberg CLA 2013-03-15 06:28:56 EDT
(In reply to comment #1)
> I think that Display fires the multi-purpose "Settings" event when the
> resolution changes.

I tried `display.addListener( SWT.Settings, listener )` in GTK, but the listener is not called when the Display resolution changes. However, `display.getBounds()` returns the updated size after the change.

Apart from the Settings event, since the bounds of the Display are changing, wouldn't it be consequent to accept a Resize listener?
Comment 3 Silenio Quarti CLA 2013-03-15 15:08:56 EDT
SWT.Settings event should work on Windows, but it is not sent on Mac and GTK when the display bounds changes.

I believe having a SWT.Resize on Display is  fine. Note that ideally SWT.Resize would have to be sent when the client area of the display changes. For example, we should get one when the task bar changes height on Windows.

I am not sure whether there is support on all platforms for this.