Community
Participate
Working Groups
Bugzilla – Bug 78965
[DetachedView] Unable to close detached view via ESC
Last modified: 2012-06-01 15:52:24 EDT
build i1117 - Detached views will close if they have focus and you hit ESC. - This works for the Progress View when it is empty. - If I have a long-running operation (like a CVS sync) going, ESC does nothing. - When the job finishes and I hit ESC, the view closes. Is this intentional?
Tod: are you attaching a key listener to the progress view? On Linux GTK+, ESC never closes the progress view. On Windows XP (Kim's machine), she sees the behaviour you describe.
Released to R3_0_maintenance
Ignore the last comment. Wrong report
Should we re-open this then? ;-)
blah
I don't add any listeners to the JobsView
I take it back. This happens on GTK+ as well. The key is that the progress view must be empty for ESC to work. If there are items in the progress view, then it does not work.
In talking with Stefan, it seems that it is not supposed to be possible to close detached views with ESC ever. This is a bug in how the shells are created for detached views.
Closing detached views with ESC has been in long enough now that it is now supported behavior.
(E3.2M1) Why is escape used to close a detached view? I find this anoying. It makes sense for dialogs when you are trying to abort an operation, but not the detached view's window. Besides ALT-F4 can be used to close the detached view window. I have a dual monitor setup and like to keep an external window open in the second monitor that contains multiple views. Sometimes when I perform an operation form the external window that I decide to abort by hitting escape, I accidentially hit escape multiple times and lose my external window with all the views that I had setup. :-( At least please provide a way to disable the escape key so it does not close the detached view window. I tried to find something in Window>Preferences...>General>Keys to disable the escape key, but I didn't see anything. Just my 2cents thx, -=mirko=-
Allowing ESC to close the detached view is very unpleasant for me - In my RCP app, I have a ViewPart that implements ISaveablePart2, and returning CANCEL from promptToSaveOnClose() doesn't stop the close from happening. The View is not closed directly, but the DetachedWindow's PartStack is still disposed, so the View loses it's site anyway. It would be a big help if this was at least made optional behavior.
I'd like to try once more to get this patch applied to the DetachedView code. Feel free to disagree or ignore me. This removes the parent shell from detached views. On all platforms, this makes it so that: (a) ESC cannot close the detached view; and (b) detached views do not obscure the main eclipse window. See also Bug 56498 and Bug 96428. The side effect is that all of the windows will appear in the task bar on Linux (not sure about other platforms). However, this is somewhat expect on Linux, as this is how The GIMP works. Index: Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java,v retrieving revision 1.298 diff -u -r1.298 WorkbenchWindow.java --- Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java 7 Oct 2005 13:30:46 -0000 1.298 +++ Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java 21 Oct 2005 13:00:18 -0000 @@ -842,7 +842,7 @@ protected void configureShell(Shell shell) { super.configureShell(shell); - detachedWindowShells = new ShellPool(shell, SWT.TOOL | SWT.TITLE | SWT.MAX | SWT.RESIZE | getDefaultOrientation()); + detachedWindowShells = new ShellPool(null, SWT.TOOL | SWT.TITLE | SWT.MAX | SWT.RESIZE | getDefaultOrientation()); String title = getWindowConfigurer().basicGetTitle(); if (title != null) {
I fully agree with #10 and #11. I just discovered the behavior myself in my RCP app (while trying to prevent Esc from closing dialogs that I use in my RCP) and it is indeed very annoying. So is there an easy way to disable this behavior as of 3.4? (In reply to comment #11) > Allowing ESC to close the detached view is very unpleasant for me - In my RCP > app, I have a ViewPart that implements ISaveablePart2, and returning CANCEL from > promptToSaveOnClose() doesn't stop the close from happening. The View is not > closed directly, but the DetachedWindow's PartStack is still disposed, so the > View loses it's site anyway. > > It would be a big help if this was at least made optional behavior.
Just to note that the effect describe3d in comment #11 has been fixed in 3.4. Savable views now prompt on close (see bug 232556). I'm going to remove the ESC handling from DW's...it's life-cycle is -not- intended to be short, logically it's part of your workbench window (which you can't close using ESC) and the pain to restore it on an accidental close is severe. In order to support accessibility we'll have to provide a system menu with at least close on it to allow the close to be accessed via the keyboard.
Moving to triage...note that this is not being marked as an enhancement because adding the 'close' menu is necessary for accessibility...
(In reply to comment #14) > I'm going to remove the ESC handling from DW's...it's life-cycle is -not- > intended to be short, logically it's part of your workbench window (which you > can't close using ESC) and the pain to restore it on an accidental close is > severe. +1 for not closing detached views when you hit ESC. Can we target this for 3.6?
For sure, the main thing that was holding it up was that it'll require a fair bit of work to manage the accessibility issues...
...which we don't have time for in 3.6. I'm going to transfer this to the 4.0 target to (hopefully) make sure that we don't paint ourselves into the corner there as well.
(In reply to comment #18) > I'm going to transfer this to the 4.0 > target to (hopefully) make sure that we don't paint ourselves into the corner > there as well. Looks like they still close when you hit the ESC key as of I20110923-1625.
How odd...I'd removed the red 'x' thinking (incorrectly as it turns out) that this would also remove the ESC behavior. I'll check with SWT to see if there is a style I can use that prevents this from happening...
Not sure if I understand the problem, but for restricting ESC to close the shell, you may register listener on SWT.Traverse and command to ignore event, like this: .addListener(SWT.Traverse, new Listener() { @Override public void handleEvent(Event e) { if (e.detail == SWT.TRAVERSE_ESCAPE) { e.doit = false; } } }); Sorry once more if I suggested something trivial and the problem is more subtle
Another one bites the dust using 4.2...;-). *** This bug has been marked as a duplicate of bug 151510 ***