Bug 4692 - Empty popup menu appears in Outline view (1GET1B1)
Summary: Empty popup menu appears in Outline view (1GET1B1)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.0   Edit
Hardware: All Linux
: P4 normal (vote)
Target Milestone: ---   Edit
Assignee: Simon Arsenault CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-11 14:21 EDT by Simon Arsenault CLA
Modified: 2002-05-30 00:55 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Arsenault CLA 2001-10-11 14:21:23 EDT
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.
Comment 1 DJ Houghton CLA 2001-10-29 16:31:23 EST
PRODUCT VERSION:
	0.118

Comment 2 Silenio Quarti CLA 2002-05-30 00:55:13 EDT
Fixed on Photon, Motif, Gtk > 20020528.