From 43f69591d2861e44e31ebc47702400b2a09fcdc6 Mon Sep 17 00:00:00 2001 From: Silenio Quarti Date: Fri, 12 Nov 2010 21:06:24 +0000 Subject: Bug 285879 - [Widgets] Wrong postion of popup menus for tray icons on linux (ubuntu) causes accidental selection of the first menu item --- .../Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java') 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; } -- cgit