Community
Participate
Working Groups
On linux, if the outline view is empty, a right mouse click will popup an empty little box for the menu. It should not show anything at all just like in Windows (is this an SWT problem?) NOTES: EJP (6/25/01 4:49:09 PM) Here is a simple SWT test. import org.eclipse.swt.widgets.*; import org.eclipse.swt.*; public class SWTTest { public static void main(String[] args) { Shell s = new Shell(); Display d = s.getDisplay(); s.setBounds(100,100,300,300); Table t = new Table(s,SWT.NONE); t.setBounds(10,10,200,200); Menu m = new Menu(t); // MenuItem mi = new MenuItem(m,0); // mi.setText("Menu Item"); t.setMenu(m); TableItem i = new TableItem(t,0); i.setText("Item 1"); i = new TableItem(t,0); i.setText("Item 2"); s.open(); while(!s.isDisposed()) { if(!d.readAndDispatch()) d.sleep(); } } } McQ (26/06/2001 9:25:05 AM) - The problem is that the application code attempts to pop up a menu with no items in it. McQ (26/06/2001 9:26:58 AM) - Check if windows behavior is to *not* pop up menu at all if there are no items in it (i.e. as opposed to popping up a zero size menu). If windows does not pop it up, then we should modify linux to handle this the same way. GWG (9/18/2001 3:06:15 PM) Windows does this. We invoke menu.setVisible(true) in Control.WM_CONTEXTMENU, but nothing is shown if the menu is empty. GWG (9/18/2001 3:23:01 PM) I don't think that we can do this on Linux properly. I tried inserting an empty menu check in Control.processMouseDown(...) right before menu.setVisible() is invoked, and: - this fixed the snippet above, BUT... - it caused a problem in Eclipse because context menus on resources are created dynamically _once the menu has been made visible_. So the menu entry count before we invoke menu.setVisible() in such cases is 0. If we skip the menu.setVisible(true) step whenever a menu has zero items then resources will never show context menus.
PRODUCT VERSION: 0.118
Fixed on Photon, Motif, Gtk > 20020528.