| Summary: | [Gtk] Shell.getSize() returns wrong value when created with style SWT.RESIZE | SWT.ON_TOP | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Pawel Piech <pawel.1.piech> |
| Component: | SWT | Assignee: | Eric Williams <ericwill> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | ericwill, lufimtse, markus.kell.r, pwebster, xixiyan |
| Version: | 4.8 | Keywords: | triaged |
| Target Milestone: | 4.9 M2 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| See Also: |
https://git.eclipse.org/r/123875 https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=820c46cbb7018b48aa8791ca34c8025246bda964 |
||
| Whiteboard: | hasSnippet | ||
This issue is still reproducible! Eric mentioned it reproduces on Gtk3.22. Bug reported on Gtk2 initially. This is a good candidate for 4.9 IMO. Gerrit change https://git.eclipse.org/r/123875 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=820c46cbb7018b48aa8791ca34c8025246bda964 (In reply to Eclipse Genie from comment #4) > Gerrit change https://git.eclipse.org/r/123875 was merged to [master]. > Commit: > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/ > ?id=820c46cbb7018b48aa8791ca34c8025246bda964 In master now. |
Build id: I20100603-1500 The Shell.adjustTrim() method seems to fail with this style combination and as a result the returned getSize() value is too small. The following snippet demonstrates the bug by calling getSize()/setSize() in a loop. public class MagicalShrinkingShell { public static void main (String [] args) { Display display = new Display (); Shell shell = new Shell (display, SWT.RESIZE | SWT.ON_TOP); GridLayout layout= new GridLayout(1, false); layout.marginHeight= 0; layout.marginWidth= 0; shell.setLayout(layout); shell.setSize (200, 200); shell.open (); for (int i = 0; i < 50; i++) { while (display.readAndDispatch ()); Point p = shell.getSize(); shell.setSize(p.x, p.y); try { Thread.currentThread().sleep(100); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } while (!shell.isDisposed()) { if (!display.readAndDispatch ()) display.sleep (); } display.dispose (); } }