| Summary: | [GTK3] Shell#setSize() in RTL shell sets x-coordinate of contained control to invalid value | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Sravan Kumar Lakkimsetti <sravankumarl> |
| Component: | SWT | Assignee: | Sravan Kumar Lakkimsetti <sravankumarl> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | arunkumar.thondapu, markus.kell.r |
| Version: | 4.4 | Flags: | sravankumarl:
review?
(arunkumar.thondapu) markus.kell.r: review+ |
| Target Milestone: | 4.5 M2 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 441566 | ||
|
Description
Sravan Kumar Lakkimsetti
This problem is observed while testing 434772 import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.*;
public class Snippet {
public static void main(String[] args) {
// System.setProperty("SWT_GTK3", "0");
Display display = new Display();
System.out.println(System.getProperty("org.eclipse.swt.internal.gtk.version"));
Shell shell = new Shell(display, SWT.NO_TRIM);
shell.setOrientation(SWT.RIGHT_TO_LEFT);
Button button = new Button(shell, SWT.PUSH);
button.setBounds(0,0,100,100);
System.out.println(button.getBounds());
System.out.println(shell.getSize());
shell.setSize(400, 400);
System.out.println(button.getBounds());
}
}
When I run the snippet with GTK2 (2.24.10), the last line is as expected:
Rectangle {0, 0, 100, 100}
But with GTK3 (libgtk-3-0 3.4.2-0ubuntu0.8 / Ubuntu 12.04), the last lines are:
Point {1050, 656}
Rectangle {-650, 0, 100, 100}
=> The x-coordinate is off by the difference between the original and the new size of the shell.
Differing to 4.5. It require more in depth changes in Native custom code(gtk3 specific) and in java code as well. potential path has been uploaded to https://git.eclipse.org/r/33063 Looks good, also works with repeated calls to Shell#setOrientation(int), and fixes the previously failing tests on GTK3: org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Display.test_map* Released with http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=8ca3e0288320ea5a604a1d351fe0b9cda6bce09f |