diff options
author | Anatoly Spektor <aspektor@redhat.com> | 2013-07-17 15:18:14 -0400 |
---|---|---|
committer | Arun Thondapu <arunkumar.thondapu@in.ibm.com> | 2013-07-18 15:13:27 +0530 |
commit | 89226ef66766ab960eecbb9ea502805403181edb (patch) | |
tree | 4c403363fb763c71085ff6bbb211c0af740cc210 | |
parent | b0e12cd4442ff21e8b024ce4ebf8ef96a0f8bc6e (diff) | |
download | eclipse.platform.swt-89226ef66766ab960eecbb9ea502805403181edb.tar.gz eclipse.platform.swt-89226ef66766ab960eecbb9ea502805403181edb.tar.xz eclipse.platform.swt-89226ef66766ab960eecbb9ea502805403181edb.zip |
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.java | 42 |
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 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 |