summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnatoly Spektor <aspektor@redhat.com>2013-07-17 15:18:14 -0400
committerAnatoly Spektor <aspektor@redhat.com>2013-07-17 15:18:14 -0400
commit157672077b000a431987c873e77bbdd273af0fd6 (patch)
treea9544e0380c11e7e6efedf6d0d4d5f2aab58dac1
parenta93fce3f5105854eeb8341437779e5e3e2bb72f1 (diff)
downloadeclipse.platform.swt-cleanup_menu_210.tar.gz
eclipse.platform.swt-cleanup_menu_210.tar.xz
eclipse.platform.swt-cleanup_menu_210.zip
413197 - Menu widget uses unused version guards 2.10 and 2.8cleanup_menu_210
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 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