Bug 246415

Summary: Shell gets deactivate event when Help menu is opened
Product: [Eclipse Project] Platform Reporter: Kevin Barnes <cocoakevin>
Component: SWTAssignee: Scott Kovatch <skovatch>
Status: NEW --- QA Contact: Silenio Quarti <Silenio_Quarti>
Severity: normal    
Priority: P3 CC: grant_gayed, skovatch
Version: 3.5   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Kevin Barnes CLA 2008-09-05 14:44:34 EDT
Run the following Snippet, open the Help menu. Notice that the shell gets a deactivate event.
Deactivate is being sent with the window resigns key. In this case the text field in the Help menu is causing the menu's window to become key.

	public static void main(String[] args) {
		try {
			final Display display = new Display();
			Display.setAppName("Menu Test");

			final Shell shell = new Shell(display);
			shell.setText("I made this");
			Menu bar = new Menu(shell, SWT.BAR);
			shell.setMenuBar(bar);
			MenuItem help = new MenuItem(bar, SWT.CASCADE);
			help.setText("Help");
			
			Menu submenu = new Menu(shell, SWT.DROP_DOWN);
			help.setMenu(submenu);
			MenuItem item = new MenuItem(submenu, SWT.PUSH);
			item.setText("a menu item");
			
			shell.setSize(200, 200);
			
			shell.addListener(SWT.Deactivate, new Listener() {
				public void handleEvent(Event event) {
					System.out.println("deactivate");
				}
			});
			shell.open();
			while (!shell.isDisposed() ) {
				if (!display.readAndDispatch())
					display.sleep();
			}
			display.dispose();
		} catch (Throwable t) {
			t.printStackTrace();
		}
	}
Comment 1 Scott Kovatch CLA 2010-06-02 14:03:30 EDT
Mass move of Kevin's open Mac Carbon & Cocoa bugs to Scott K.
Comment 2 Eclipse Webmaster CLA 2019-09-06 16:12:42 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.