JetBrains / jewel

An implementation of the IntelliJ look and feels in Compose for Desktop
Apache License 2.0
744 stars 40 forks source link

Toolwindow focus in the IDE doesn't get the focus #174

Open rock3r opened 1 year ago

rock3r commented 1 year ago

Whenever a toolwindow is opened onto a Compose-based tab, the compose panel doesn't get focused. This doesn't seem to happen with Swing UIs.

https://github.com/JetBrains/jewel/assets/153802/5b703225-fc27-4d9e-80fa-1c36aaab653b

rock3r commented 1 year ago

@Walingar news on this? Is it fixed in 1.5.10?

rock3r commented 1 year ago

Tracked on the Compose Multiplatform side in https://github.com/JetBrains/compose-multiplatform/issues/3888

Walingar commented 9 months ago

There are two parts wit this issue:

  1. IntelliJ side. To workaround it, you need to wrap your ComposePanel with JPanel
  2. Compose side: Compose for desktop should provide a way to define default focusable.
rock3r commented 9 months ago

To clarify, you mean that the JPanel thing will always be needed? Or that it's only a workaround that is needed for now? And, is there a CfD issue tracking the second half, or should I create one?

Walingar commented 9 months ago

Thing about JPanel comes from implementation of Toolwindow, that requests next focusable target from ComposePanel. I guess it can be workarounded from both sides (Compose or Jewel) Second part is described well in the issue that you mentioned before

rock3r commented 9 months ago

Ah, totally missed the link :) If the JPanel is a workaround we'll need long term, we can easily enough add it in the implementation of the addComposeTab() extension function at least