aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnatoly Spektor2013-07-17 15:18:14 (EDT)
committerArun Thondapu2013-07-18 05:43:27 (EDT)
commit89226ef66766ab960eecbb9ea502805403181edb (patch)
tree4c403363fb763c71085ff6bbb211c0af740cc210
parentb0e12cd4442ff21e8b024ce4ebf8ef96a0f8bc6e (diff)
downloadeclipse.platform.swt-89226ef66766ab960eecbb9ea502805403181edb.zip
eclipse.platform.swt-89226ef66766ab960eecbb9ea502805403181edb.tar.gz
eclipse.platform.swt-89226ef66766ab960eecbb9ea502805403181edb.tar.bz2
413197 - Menu widget uses unused version guards 2.10 and 2.8
Signed-off-by: Anatoly Spektor <aspektor@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java42
1 files changed, 19 insertions, 23 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 57d3beb..9945a6d 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