summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java
diff options
context:
space:
mode:
authorSilenio Quarti <silenio>2010-11-12 21:06:24 +0000
committerSilenio Quarti <silenio>2010-11-12 21:06:24 +0000
commit43f69591d2861e44e31ebc47702400b2a09fcdc6 (patch)
tree855f8d7edc21c3e282c90cf07631c255a3981a99 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java
parent0aefae2205ecbebdf2518c8c6d05ab0032e5adad (diff)
downloadeclipse.platform.swt-43f69591d2861e44e31ebc47702400b2a09fcdc6.tar.gz
eclipse.platform.swt-43f69591d2861e44e31ebc47702400b2a09fcdc6.tar.xz
eclipse.platform.swt-43f69591d2861e44e31ebc47702400b2a09fcdc6.zip
Bug 285879 - [Widgets] Wrong postion of popup menus for tray icons on linux (ubuntu) causes accidental selection of the first menu item
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java
index ca2e9be981..3484fef1b5 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java
@@ -329,7 +329,15 @@ int /*long*/ gtk_size_allocate (int /*long*/ widget, int /*long*/ allocation) {
}
int /*long*/ gtk_status_icon_popup_menu (int /*long*/ widget, int /*long*/ button, int /*long*/ activate_time) {
+ /*
+ * GTK provides a MenuPositionFunc for GtkStatusIcon in order
+ * to set the popup-menu aligned to the tray.
+ */
+ Display display = this.display;
+ display.currentTrayItem = this;
sendEvent (SWT.MenuDetect);
+ if (!isDisposed ()) display.runPopups();
+ display.currentTrayItem = null;
return 0;
}