Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 117577

Summary: [Commands] request: Close dialogs on Command+W
Product: [Eclipse Project] Platform Reporter: Kaj Hejer <kaj.hejer>
Component: UIAssignee: Paul Webster <pwebster>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P5 CC: eclipse, markus.kell.r, Silenio_Quarti, snorthov
Version: 3.2Keywords: helpwanted
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Kaj Hejer CLA 2005-11-22 15:35:28 EST
On MacOS X most windows can be closed with command-w. If I open the find/replace window in eclipse and want to close it, I would expect to be able to close it with command-w then the find/replace window has focus, but that does not work.

I'm on MacOS X 10.4.3 with eclipse 3.2M3.
Comment 1 Silenio Quarti CLA 2006-03-22 16:51:11 EST
Steve, should we make Cmd+w send a SWT.Traverse event with detail=SWT.TRAVERSE_ESCAPE?
Comment 2 Steve Northover CLA 2006-03-23 09:26:13 EST
Sounds ok.  I don't have a Mac here at EclipseCon.  Can you verify the statement that "most windows can be closed" on a bunch of native apps?  Also, does Eclipse use Cmd+W for anything (it shouldn't)?
Comment 3 Silenio Quarti CLA 2006-03-23 11:11:29 EST
Apps usually have a MenuItem with an accelerator Cmd+w that closes the active window. The problem with eclipse is that the menu bar is cleared when the Find/Replace dialog is up.
Comment 4 Steve Northover CLA 2006-03-27 11:36:11 EST
Ok, I don't think we should do this.  It sounds like this should be done by those above us, not SWT.
Comment 5 Silenio Quarti CLA 2006-03-27 14:41:13 EST
Ok, moving to UI to get their thoughts.
Comment 6 Douglas Pollock CLA 2006-03-29 11:09:08 EST
Okay, we could do this at the workbench level.  I'm not convinced that is great idea, as this means MOD1+W would close dialogs on all platforms.  Since the user asks for platform-specific behaviour, it is probably be better to handle this in SWT land.

If UI were to do it, we would do the following:
+ Add a default handler for the "Close" command that closes the active shell.
+ Change the "M1+W" binding to be in dialogAndWindow (rather than window).
Comment 7 Steve Northover CLA 2006-03-29 12:24:47 EST
I don't think UI should do this unless they step up to a real, Mac style UI where the menu bar is not replaced when a dialog comes up.  This would require new API in Display (Display.setMenuBar()) and for all code in Eclipse to be changed to NEVER call Shell.setMenuBar().  Display.setMenuBar() would do nothing on the other platforms.

Since this is a huge amount of work and relies on API that is not there yet, we shouldn't do this.
Comment 8 Steve Northover CLA 2006-03-29 12:25:32 EST
I mean "unless we step up" rather than "unless they step up".
Comment 9 Michael Van Meekeren CLA 2006-04-21 13:21:36 EDT
Moving Dougs bugs
Comment 10 Markus Keller CLA 2009-09-15 06:28:50 EDT

*** This bug has been marked as a duplicate of bug 94153 ***