Bug 402514

Summary: Add support for display resize listener
Product: [Eclipse Project] Platform Reporter: Ivan Furnadjiev <ivan>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: hudsonr, markus.kell.r, Silenio_Quarti
Version: 4.2   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 201261    

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.