| Summary: | Size-related problems on Kubuntu | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Thomas Singer <eclipse> | ||||
| Component: | SWT | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> | ||||
| Status: | RESOLVED WORKSFORME | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | akurtakov, ericwill | ||||
| Version: | 4.3 | Keywords: | triaged | ||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Linux-GTK | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
The problem also can be reproduced on Ubuntu 12.04:
default size: Point {206, 129}
Bounds: Rectangle {0, 0, 206, 129}, clientArea: Rectangle {0, 0, 200, 100}
Bounds: Rectangle {49, 567, 202, 131}, clientArea: Rectangle {0, 0, 200, 102}
Is this still reproducible? Have you tried it? Even with the latest SWT 4.7 the set minimum size seems to be ignored (tried Fedora 27). (In reply to Thomas Singer from comment #0) > default size: Point {206, 129} > Bounds: Rectangle {0, 0, 206, 129}, clientArea: Rectangle {0, 0, 200, 100} > Bounds: Rectangle {0, 0, 204, 128}, clientArea: Rectangle {0, 0, 200, 101} > > This means, the actual window size becomes smaller than its set minimum size! Is this not by design? The client area is the area in which the widget is capable of displaying data (i.e. minus all trimmings). I observe a ~30 px difference in height between the default size, and the client area. This accounts for the height of the title bar, which is about the same (~30 px). IMO this isn't a bug, as the default size returns the preferred size of the entire Shell widget, including trimmings. The client area is the size of the Shell minus these components. (In reply to Eric Williams from comment #4) > (In reply to Thomas Singer from comment #0) > > default size: Point {206, 129} > > Bounds: Rectangle {0, 0, 206, 129}, clientArea: Rectangle {0, 0, 200, 100} > > Bounds: Rectangle {0, 0, 204, 128}, clientArea: Rectangle {0, 0, 200, 101} > > > > This means, the actual window size becomes smaller than its set minimum size! > > Is this not by design? Err, no, the set minimum size should be the _minimum_ size. It should NOT be possible to resize the window to become smaller than the set minimum size. (In reply to Thomas Singer from comment #5) > Err, no, the set minimum size should be the _minimum_ size. It should NOT be > possible to resize the window to become smaller than the set minimum size. Correct, but the bounds are reflecting that. The client area isn't the same as the widget size. The client area will always be <= the bounds, as there are trimmings to take into account. Bounds will always be >= minimum size. I believe the output from comment 0 reflects that. Also on my Fedora 28 system with SWT 4.8 M7, I cannot get the bounds to be smaller than the minimum size. (In reply to Eric Williams from comment #6) > (In reply to Thomas Singer from comment #5) > > Err, no, the set minimum size should be the _minimum_ size. It should NOT be > > possible to resize the window to become smaller than the set minimum size. > > Correct, but the bounds are reflecting that. The client area isn't the same > as the widget size. > > The client area will always be <= the bounds, as there are trimmings to take > into account. Bounds will always be >= minimum size. I believe the output > from comment 0 reflects that. No, they did not reflect this. Though a minimum size of {206, 129} had been set, I was able to size the shell to {0, 0, 204, 128} (204 < 206 and 128 < 129). (In reply to Thomas Singer from comment #7) > No, they did not reflect this. Though a minimum size of {206, 129} had been > set, I was able to size the shell to {0, 0, 204, 128} (204 < 206 and 128 < > 129). Does it get any smaller than this? I'm wondering if maybe there is some small trimming (a border or something that's ~2px) not being taken into account. Does the issue still reproduce for you on Kubuntu? Or even Fedora? (In reply to Eric Williams from comment #8) > (In reply to Thomas Singer from comment #7) > > No, they did not reflect this. Though a minimum size of {206, 129} had been > > set, I was able to size the shell to {0, 0, 204, 128} (204 < 206 and 128 < > > 129). > > Does it get any smaller than this? I'm wondering if maybe there is some > small trimming (a border or something that's ~2px) not being taken into > account. Does the issue still reproduce for you on Kubuntu? Or even Fedora? I've reinstalled Kubuntu 16.10 now. With 4.7 I was able to reproduce this problem (it printed 2 "Bounds: " lines as shown in the initial posting), but with 4.8M7 only 1 "Bounds: " line is shown and I was not able any more to make the shell smaller than its initially set minimum size. (In reply to Thomas Singer from comment #9) > I've reinstalled Kubuntu 16.10 now. With 4.7 I was able to reproduce this > problem (it printed 2 "Bounds: " lines as shown in the initial posting), but > with 4.8M7 only 1 "Bounds: " line is shown and I was not able any more to > make the shell smaller than its initially set minimum size. This is the same behaviour I see on Fedora 28 with 4.8 M7. I'm going to close this ticket, please let me know if this bug reappears somewhere. |
Created attachment 230717 [details] screenshot When running following code on Kubuntu 13.04 with SWT (gtk.linux bundle, version 4.317): final Display display = new Display(); final Shell shell = new Shell(display, SWT.SHELL_TRIM); shell.setText("Kubuntu-Test"); shell.setLayout(new Layout() { @Override protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) { return new Point(200, 100); } @Override protected void layout(Composite composite, boolean flushCache) { System.out.println("Bounds: " + shell.getBounds() + ", clientArea: " + shell.getClientArea()); } }); final Point defaultSize = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT); System.out.println("default size: " + defaultSize); shell.setMinimumSize(defaultSize); shell.setSize(defaultSize); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); and resize the bottom corner of the window, I'm getting following output: default size: Point {206, 129} Bounds: Rectangle {0, 0, 206, 129}, clientArea: Rectangle {0, 0, 200, 100} Bounds: Rectangle {0, 0, 204, 128}, clientArea: Rectangle {0, 0, 200, 101} This means, the actual window size becomes smaller than its set minimum size!