From 89226ef66766ab960eecbb9ea502805403181edb Mon Sep 17 00:00:00 2001 From: Anatoly Spektor Date: Wed, 17 Jul 2013 15:18:14 -0400 Subject: 413197 - Menu widget uses unused version guards 2.10 and 2.8 Signed-off-by: Anatoly Spektor --- .../gtk/org/eclipse/swt/widgets/Menu.java | 42 ++++++++++------------ 1 file changed, 19 insertions(+), 23 deletions(-) (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org') 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 57d3bebb22..9945a6d1dc 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 @@ -197,33 +197,29 @@ void _setVisible (boolean visible) { if (visible) { sendEvent (SWT.Show); if (getItemCount () != 0) { - if ((OS.GTK_VERSION >= OS.VERSION (2, 8, 0))) { - /* - * Feature in GTK. ON_TOP shells will send out - * SWT.Deactivate whenever a context menu is shown. - * The fix is to prevent the menu from taking focus - * when it is being shown in an ON_TOP shell. - */ - if ((parent._getShell ().style & SWT.ON_TOP) != 0) { - OS.gtk_menu_shell_set_take_focus (handle, false); - } + /* + * Feature in GTK. ON_TOP shells will send out + * SWT.Deactivate whenever a context menu is shown. + * The fix is to prevent the menu from taking focus + * when it is being shown in an ON_TOP shell. + */ + if ((parent._getShell ().style & SWT.ON_TOP) != 0) { + OS.gtk_menu_shell_set_take_focus (handle, false); } long /*int*/ address = hasLocation ? display.menuPositionProc: 0; hasLocation = false; long /*int*/ data = 0; - if ((OS.GTK_VERSION >= OS.VERSION (2, 10, 0))) { - /* - * Popup-menu to the status icon should be aligned to - * Tray rather than to cursor position. There is a - * possibility (unlikely) that TrayItem might have - * been disposed in the listener, for which case - * the menu should be shown in the cursor position. - */ - TrayItem item = display.currentTrayItem; - if (item != null && !item.isDisposed()) { - data = item.handle; - address = OS.gtk_status_icon_position_menu_func (); - } + /* + * Popup-menu to the status icon should be aligned to + * Tray rather than to cursor position. There is a + * possibility (unlikely) that TrayItem might have + * been disposed in the listener, for which case + * the menu should be shown in the cursor position. + */ + TrayItem item = display.currentTrayItem; + if (item != null && !item.isDisposed()) { + data = item.handle; + address = OS.gtk_status_icon_position_menu_func (); } /* * Bug in GTK. The timestamp passed into gtk_menu_popup is used -- cgit