eclipse-platform / eclipse.platform.ui

Eclipse Platform
https://projects.eclipse.org/projects/eclipse.platform
Eclipse Public License 2.0
71 stars 155 forks source link

Shortcuts do not work in "Java Type Hierarchy" perspective #686

Open iloveeclipse opened 1 year ago

iloveeclipse commented 1 year ago

I've used to see "Ctrl+3" (and most of other shortcuts) not always working in a new workspaces / default SDK Java perspective, but I wasn't able to provide reproducible steps.

Now I found a way to do so.

While reviewing https://github.com/eclipse-jdt/eclipse.jdt.ui/pull/507 I've opened "Java Type Hierarchy" perspective and just tried to use "Ctrl+3" there - nada, no effect at all, and same for all other commands!

Now I've switched back to Java perspective, triggered there "Ctrl + 3", switched back to "Java Type Hierarchy" perspective - and all the shortcuts started to work!

Steps to reproduce: 1) Start SDK with a new workspace (Java perspective will be opened), close welcome editor. 2) Switch to "Java Type Hierarchy" perspective by clicking on "Open perspective" toolbar icon in the upper right corner. 3) "Ctrl+3" -> no effect 4) Switch back to "Java" perspective 5) "Ctrl+3" -> no effect 6) Click inside empty Outline view 7) "Ctrl+3" -> works 8) Switch again to "Java Type Hierarchy" 9) "Ctrl+3" -> works 10) Switch to "Java" perspective and close "Java Type Hierarchy" perspective 11) Switch to "Java Type Hierarchy" perspective by clicking on "Open perspective" toolbar icon in the upper right corner. 12) "Ctrl+3" -> no effect again!

So looks like until some view actively set focus in some perspective, shortcuts won't work.

I believe this is not a recent regression.

ChristianR2 commented 1 year ago

@iloveeclipse pointed me to this issue.

I verified, I can reproduce this on Linux (using Plug in development eclipse 4.27 and replacing Java perspective with plug-in development perspective) on Ubuntu 22.04.2 LTS, Java 17.0.6 (Temurin) (X11 not Wayland)

I verified I can't reproduce it on Windows 10, Java 17.

I saw a similar problem with key bindings in my RCP application at least on 4.9 and 4.27. Problem is that key bindings do not work on Linux until I explicitly set a focus somewhere. On Windows it works. The problem seemed to be independent of the Ubuntu version I used.