diff options
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java index 7a45c3af0d..5bb5e3e674 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java @@ -378,24 +378,12 @@ void fixMenus (Decorations newParent) { int /*long*/ window = gtk_widget_get_window (handle); int [] origin_x = new int [1], origin_y = new int [1]; OS.gdk_window_get_origin (window, origin_x, origin_y); - int x = 0; - int y = 0; - int width = 0; - int height = 0; GtkAllocation allocation = new GtkAllocation (); - if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { - OS.gtk_widget_get_allocation(handle, allocation); - x = origin_x [0] + allocation.x; - y = origin_x [0] + allocation.y; - width = allocation.width; - height = allocation.height; - } else { - x = origin_x [0] + OS.GTK_WIDGET_X (handle); - y = origin_y [0] + OS.GTK_WIDGET_Y (handle); - width = OS.GTK_WIDGET_WIDTH (handle); - height = OS.GTK_WIDGET_HEIGHT (handle); - } - + gtk_widget_get_allocation (handle, allocation); + int x = origin_x [0] + allocation.x; + int y = origin_x [0] + allocation.y; + int width = allocation.width; + int height = allocation.height; return new Rectangle (x, y, width, height); } @@ -960,11 +948,7 @@ public void setDefaultItem (MenuItem item) { */ public void setEnabled (boolean enabled) { checkWidget(); - if (enabled) { - OS.gtk_widget_set_sensitive (handle, true); - } else { - OS.gtk_widget_set_sensitive (handle, false); - } + OS.gtk_widget_set_sensitive (handle, enabled); } /** |