summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT
diff options
context:
space:
mode:
authorAnatoly Spektor <aspektor@redhat.com>2012-08-07 15:26:07 -0400
committerArun Thondapu <arunkumar.thondapu@in.ibm.com>2012-08-09 16:16:23 +0530
commit6207053cbabec2bceac5c0fcadb16091fc8a4c80 (patch)
tree0ba846507e3ec6af38f74e21130f1b9c770f3625 /bundles/org.eclipse.swt/Eclipse SWT
parent61f50052042e8e5211eed2203f3ae39ad0765025 (diff)
downloadeclipse.platform.swt-6207053cbabec2bceac5c0fcadb16091fc8a4c80.tar.gz
eclipse.platform.swt-6207053cbabec2bceac5c0fcadb16091fc8a4c80.tar.xz
eclipse.platform.swt-6207053cbabec2bceac5c0fcadb16091fc8a4c80.zip
Bug 386778 Omit use of GTK_WIDGET_SET_X and GTK_WIDGET_SET_Y in newer GTK+
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java20
1 files changed, 17 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
index 83d1920130..209fadab90 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
@@ -4190,12 +4190,26 @@ void setInitialBounds () {
* expected by SWT.
*/
int /*long*/ topHandle = topHandle ();
+ GtkAllocation allocation = new GtkAllocation();
if ((parent.style & SWT.MIRRORED) != 0) {
- OS.GTK_WIDGET_SET_X (topHandle, parent.getClientWidth ());
+ if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
+ allocation.x = parent.getClientWidth ();
+ } else {
+ OS.GTK_WIDGET_SET_X (topHandle, parent.getClientWidth ());
+ }
+ } else {
+ if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
+ allocation.x = 0;
+ } else {
+ OS.GTK_WIDGET_SET_X (topHandle, 0);
+ }
+ }
+ if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
+ allocation.y = 0;
+ OS.gtk_widget_set_allocation(topHandle, allocation);
} else {
- OS.GTK_WIDGET_SET_X (topHandle, 0);
+ OS.GTK_WIDGET_SET_Y (topHandle, 0);
}
- OS.GTK_WIDGET_SET_Y (topHandle, 0);
} else {
resizeHandle (1, 1);
forceResize ();