Bug 562263 - Key binding for context doesn't work if child context is active
Summary: Key binding for context doesn't work if child context is active
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.12   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.16 M3   Edit
Assignee: Rolf Theunissen CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 552208
  Show dependency tree
 
Reported: 2020-04-17 09:51 EDT by Simeon Andreev CLA
Modified: 2020-04-26 14:36 EDT (History)
2 users (show)

See Also:


Attachments
Example plug-in to reproduce the problem with, see the reproduction steps in the description. (6.80 KB, application/zip)
2020-04-17 09:51 EDT, Simeon Andreev CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simeon Andreev CLA 2020-04-17 09:51:38 EDT
Created attachment 282500 [details]
Example plug-in to reproduce the problem with, see the reproduction steps in the description.

Steps to reproduce:

1. Import the example plug-in from the attached "ExamplePlugin.zip".
2. Click on the added toolbar button "Activate Child Context".
3. Use key bind Ctrl+L, observe that the key bind is not handled.

The example plug-in defines 2 commands, one with a key bind for a specific context and another command, which activates a child of that context. Using the key bind, once the child context is active, doesn't work.

We observe this problem in Eclipse 4.12, but I can reproduce it also in:

Eclipse SDK
Version: 2020-06 (4.16)
Build id: I20200409-0200

I can also reproduce it in the earliest 4.x version I have:

Eclipse SDK
Version: 4.2.0
Build id: I20120608-1400

The same example plug-in works fine with:

Eclipse SDK
Version: 3.8.2
Build id: M20130131-0800
Comment 1 Simeon Andreev CLA 2020-04-17 09:54:49 EDT
If I ask for the parent context table during org.eclipse.e4.ui.bindings.internal.BindingTableManager.getPerfectMatch(ContextSet, TriggerSequence) (i.e. call getTable(c.getParentId())), that table contains the binding. I don't know if BindingTableManager.getPerfectMatch() should check binding tables of parent contexts, if the current table doesn't contain anything for the key bind. Maybe yes.
Comment 2 Rolf Theunissen CLA 2020-04-20 02:26:05 EDT
Indeed in 3.8 the parent context is considered/made active when a child context is made active. In 4.x the parent context is not put in the active contexts, nor is it considered while looking for active keybindings.
Comment 3 Eclipse Genie CLA 2020-04-20 15:55:09 EDT
New Gerrit change created: https://git.eclipse.org/r/161251