Bug 48486 - [ActionSets] Key bindings not working when Eclipse first opened
Summary: [ActionSets] Key bindings not working when Eclipse first opened
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P1 critical (vote)
Target Milestone: 3.0 M6   Edit
Assignee: Douglas Pollock CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 48614 48627 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-12-11 09:50 EST by Douglas Pollock CLA
Modified: 2003-12-17 09:22 EST (History)
5 users (show)

See Also:


Attachments
Apply patch to ActionPresentation.java (3.00 KB, patch)
2003-12-15 13:55 EST, Kostas Sakellis CLA
no flags Details | Diff
Configuration info from my workspace (375.49 KB, text/plain)
2003-12-16 09:55 EST, Philipe Mulet CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Douglas Pollock CLA 2003-12-11 09:50:47 EST
On I20031211, Pascal is reporting that he cannot use the 'F6' keyboard
accelerator.  This is bound (by default) in the "Default" key configuration.
Comment 1 Pascal Rapicault CLA 2003-12-11 09:56:15 EST
I can now use F6 again.
It seems that the problem was coming from my existing workspace.

When I started I20031211 on this existing workspace F6 was not working. 
I changed the key bindings and it was still problematic.
Finally I reset them to "default", shutdown and started up again, and 
everything was fine.
Comment 2 Douglas Pollock CLA 2003-12-11 10:12:45 EST
This might be important: can you tell me what version of workspace you were 
using previously?  Something like "I opened a workspace from I200312xx in 
I20031211".
Comment 3 Pascal Rapicault CLA 2003-12-11 10:22:46 EST
I believe that my workspace was from I20031209
Comment 4 Douglas Pollock CLA 2003-12-11 10:29:55 EST
The workaround is to use the keys preference page to change your key 
configuration and then restart Eclipse.  The problem occurs with old 
workspaces using both the default key configuration and the new 3.0 key 
configuration.

(Perhaps related (perhaps not) is menu disablement problem.  The entire source 
menu was sometimes disabled.)  
Comment 5 Douglas Pollock CLA 2003-12-11 10:37:19 EST
I have just tested (on Windows XP), the following scenario: open Eclipse (key 
bindings don't work), immediately close Eclipse, open Eclipse again (key 
bindings do work).  Changing the key configuration may be a red herring.
Comment 6 Douglas Pollock CLA 2003-12-11 11:03:42 EST
I haven't be able to figure out how to get the bug "back" once I've restarted
Eclipse.  It's making it hard to reproduce.  Opening the workspace with an older
version, exiting, and the opening with a newer version doesn't seem to do it....
Comment 7 Douglas Pollock CLA 2003-12-11 11:30:24 EST
I also seem to recall the main Workbench preference page not appearing.  Could
this be an activities related problem?
Comment 8 Chris McLaren CLA 2003-12-11 12:54:37 EST
i loaded 0800 (i was using 1227 from yesterday) and i got the problem again. i 
close and restart fixed it. now i can't get it back either. weird. i'd like to 
think we have a self-correcting problem where persisting the workspace simply 
fixes the problem. ps. doug, these are your bugs until you can show that its a 
problem with the engine..
Comment 9 Douglas Pollock CLA 2003-12-11 16:51:36 EST
This bug exists on all platforms and operating systems.

However, I cannot reproduce this problem.  I have even tried hitting up other
people for workspaces.  It is not simply a matter of an old workspace; there is
something more to it than that.

Is it perhaps possible that only a workspace that has gone through a particular
series of integration builds can see this corruption?

I'm going to mark this bug as "WORKSFORME".  I can't reproduce, and I can't
figure out why this would occur.  If anyone has more information, please re-open
this bug.
Comment 10 Chris McLaren CLA 2003-12-11 17:05:33 EST
this can be reproduced regularly. i can't guarantee you exact steps, but i've 
been stuck on this all day upon returning from running the runtime workbench. 

perhaps the fact that the runtime workbench shell closes?

anything happening with Shells in the past few days? (I saw some stuff in 
WorkbenchKeyboard about Shell stuff?)
Comment 11 Douglas Pollock CLA 2003-12-11 17:17:28 EST
Closing the workspace fixes the problem -- unfortunately, forever.  Once a 
workspace is closed normally I can't reproduce the problem.  I've been without 
a workspace that is broken.

If you have a broken workspace, please make it available on the network file 
shares.
Comment 12 Chris McLaren CLA 2003-12-11 17:57:47 EST
this is not a problem of older workspaces. the proof is easy: i started with a 
clean workspace this morning with today's 0800 I-build.

i have always been able to fix this problem by restarting. sometimes this 
problem recurs. i notice it has recurred shortly after closing a run or debug 
session.
Comment 13 Darin Wright CLA 2003-12-12 09:53:10 EST
*** Bug 48627 has been marked as a duplicate of this bug. ***
Comment 14 Douglas Pollock CLA 2003-12-12 10:53:58 EST
I can now reproduce this problem in a self-hosted workspace.

STEPS TO REPRODUCE:
1.) Open a fresh workspace (self-hosted possible)
2.) Open the CVS perspective.
3.) Add a pserver connection to dev.eclipse.org and checkout some modules.
4.) Switch to the Java perspective as the checkout is occurring.
5.) Import binary projects to fill the gaps.
6.) Press "Ctrl+Shift+T".


DESIRED RESULTS:
The "Open Type" dialog should open.


ACTUAL RESULTS:
The dialog does not open.  Debugging println statements in WorkbenchKeyboard
indicate that no key down events are being received.
Comment 15 Douglas Pollock CLA 2003-12-12 13:40:17 EST
An update:
Step #5 is not necessary.  At Step #6, the cursor is not visible even though
both the editor view and the window appear to have focus.  Clicking within the
editor causes the cursor to appear, and the key bindings start working.
Comment 16 Douglas Pollock CLA 2003-12-12 13:48:23 EST
Refinement:
In a running workbench, switch to the CVS perspective and then switch back to
the Java perspective.  "Ctrl+Shift+T" does not work.
Comment 17 Douglas Pollock CLA 2003-12-12 14:11:34 EST
SWT: Can you comment on this bug?  We have a key filter enabled on Display, and
we are not receiving key events.  To see the effect you can do the following
(I20031211):

1.) Open Eclipse with a fresh workspace.
2.) Switch to the "CVS Repository Exploring" perspective.
3.) Switch back to the "Resource" perspective.
4.) Press "Ctrl+Shift+R".

If done with a debugger, it can be shown that our key binding listener is not
receiving any events (WorkbenchKeyboard.filterKeySequenceBindings).

Other things to note: the key binding listener is removed and added back once
during initial start-up, and is removed and added back twice when switching to
the CVS perspective.  This is to disable key bindings while performing a
blocking operation.
Comment 18 Douglas Pollock CLA 2003-12-12 14:12:24 EST
Ooops.  Missed one step:
1.5) Switch focus to the navigator view, and then back to the welcome editor.
Comment 19 Steve Northover CLA 2003-12-12 16:41:53 EST
Debugged this with Doug and determined that there were 2 problems, one his and 
one mine.  The GTK problem was fixed in the latest accidently by Grant (when a 
control was hidden, GTK was assigning focus to nowhere).  Moving back to UI.
Comment 20 Douglas Pollock CLA 2003-12-12 16:44:52 EST
The remaining bug I believe has to do with focus percolating through the
workbench.  We are now receiving events, and I'm beginning to debug this
problem.  This bug may be related to Bug 48644 -- where menu items are disabled.
Comment 21 Douglas Pollock CLA 2003-12-12 17:34:46 EST
At least part of the remaining problem is tied into the incorrect updating of
handlers.  I'm not sure why this is happening...

open eclipse  ----> open resource has a handler
switch to cvs perspective ----> open resource does not have a handler
switch back to resource perspective ----> open resource does *not* have a handler

The "setActionsById" method is getting called however, just with a bad map....
Comment 22 Douglas Pollock CLA 2003-12-12 17:59:06 EST
This will likely not be fixed before the warm-up build on Monday morning.  Many
apologies.
Comment 23 Douglas Pollock CLA 2003-12-15 10:29:32 EST
Getting closer to understanding what's going on.  It looks like the action set
itself is being cleared somehow.  When the resource perspective is initially
opened, the action sets look like:

	actionSet[0] = "Help Search"@{ &Help... }
	actionSet[1] = "Resource Navigation"@{ &Resource..., Open Reso&urce... }
	actionSet[2] = "Editor Navigation"@{ Go to Last Edit Location }
	actionSet[3] = "Search"@{ &File..., Se&arch... }
	actionSet[4] = "Open External Files"@{ Open External File... }
	actionSet[5] = "Help"@{ &Help Contents }
	actionSet[6] = "Software Updates"@{ &Manage Configuration..., &Find and
Install... }
	actionSet[7] = "ReadMe Actions"@{ &Open Readme Browser, &Open Readme Browser
(Retarget), &Open Readme Browser (Retarget - Label Update) }
	actionSet[8] = "External Tools"@{ &External Tools, &External Tools }


When opened the second time, the action sets look like the following.  Notice
that the "Resource Navigation" action set is now empty.  Also a bit puzzling is
that there is a null action set.

	actionSet[0] = "Help Search"@{ &Help... }
	actionSet[1] = "Resource Navigation"@{  }
	actionSet[2] = "Editor Navigation"@{ Go to Last Edit Location }
	actionSet[3] = "Search"@{ &File..., Se&arch... }
	actionSet[4] = "Open External Files"@{ Open External File... }
        actionSet[5] = null
	actionSet[6] = "Help"@{ &Help Contents }
	actionSet[7] = "Software Updates"@{ &Manage Configuration..., &Find and
Install... }
	actionSet[8] = "ReadMe Actions"@{ &Open Readme Browser, &Open Readme Browser
(Retarget), &Open Readme Browser (Retarget - Label Update) }
	actionSet[9] = "External Tools"@{ &External Tools, &External Tools }
Comment 24 Douglas Pollock CLA 2003-12-15 11:20:07 EST
I have traced the problems to a change made to ActionPresentation on December
9th (committed by Tod, but the change was to support Kosta's cool bar work). 
Reverting to revision 1.9 fixes the problem.

In speaking with Kosta, it seems that he's tried to introduce a third state for
action sets (and action bars?).  Previously, they would either exist or be
disposed.  Now, they can exist, be deactivated or be disposed.  Deactivation
being a kind of "soft dispose".  Unfortunately, the code that reactivates the
action sets and action bars does not handle this new state properly.  This
results in action sets becoming trapped in a deactivated state.

This bug may still be related to Bug 48644.  I have yet to make a reproducible
test case for that bug with which to test.
Comment 25 Douglas Pollock CLA 2003-12-15 12:02:01 EST
There may be more to it then just the ActionPresentation change.  If what I
describe is a wholly unrelated bug, please file it separately and assign it to me.

STEPS TO REPRODUCE:
1.) Open a fresh workspace, create a java project (switch to java perspective).
2.) Create a new class.
3.) Switch to welcome editor.
4.) Switch to java file.
5.) Switch to resource perspective.
6.) Switch to welcome editor.
7.) Switch to java file.


OBSERVED RESULTS:
At steps #2 and #5, the source menu does not appear with key bindings and the
missing key bindings do not work.  At steps #4 and #7, the key bindings do
appear.  Basically, switching perspectives or opening an editor does not appear
to update the key bindings, while switching editors does.
Comment 26 Kostas Sakellis CLA 2003-12-15 13:55:21 EST
Created attachment 7168 [details]
Apply patch to ActionPresentation.java

This patch fixes key binding problems. Apply as described.
Comment 27 Kostas Sakellis CLA 2003-12-15 13:56:17 EST
The patch fixes key binding issues. Apply the patch to ActionPresentation.java.
Comment 28 Douglas Pollock CLA 2003-12-15 14:19:44 EST
This patch has been applied to CVS, and should appear in I200312160010.
Comment 29 Douglas Pollock CLA 2003-12-15 14:21:53 EST
*** Bug 48614 has been marked as a duplicate of this bug. ***
Comment 30 Philipe Mulet CLA 2003-12-16 07:10:18 EST
Problem is still there in 20031216
Comment 31 Philipe Mulet CLA 2003-12-16 07:10:58 EST
also see bug 48832
Comment 32 Philipe Mulet CLA 2003-12-16 07:12:28 EST
I am still using an old workspace which was previously running on 20031211, 
where I had some key binding issues (different sessions had different 
problems). But this time around it feels like all key bindings are gone, and I 
do not get any different behavior from a session to the other.
Comment 33 Nick Edgar CLA 2003-12-16 09:34:46 EST
What Philippe is seeing sounds more like the original problem reported here, 
not the problem with action set handlers.  It's not working when first started 
up.  He did not say he was switching perspectives.

Philippe has posted his workspace to ott4f under /teams/Eclipse-
Platform/anon/in/48486.
Comment 34 Douglas Pollock CLA 2003-12-16 09:35:18 EST
*** Bug 48832 has been marked as a duplicate of this bug. ***
Comment 35 Douglas Pollock CLA 2003-12-16 09:53:40 EST
This bug, as described, seems fixed.  The problems described by Philippe don't 
seem to be a new bug.
Comment 36 Philipe Mulet CLA 2003-12-16 09:55:03 EST
Created attachment 7184 [details]
Configuration info from my workspace