Open igordmn opened 2 years ago
Pure Swing reproducer (JDK 15):
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.swing.Swing
import java.awt.Dimension
import java.awt.event.MouseEvent
import java.awt.event.MouseMotionListener
import javax.swing.JFrame
fun main() {
runBlocking(Dispatchers.Swing) {
val window = JFrame().apply {
addMouseMotionListener(object : MouseMotionListener {
override fun mouseDragged(e: MouseEvent?) = Unit
override fun mouseMoved(e: MouseEvent?) = println("mouseMoved")
})
addMouseWheelListener {
println("mouseWheelMoved")
}
size = Dimension(500, 500)
isVisible = true
}
launch {
while(true) {
delay(500)
println(window.focusOwner)
}
}
}
}
IDEA has this issue too
The issue in the Alt
key. When we press it, usually the top menu receives the focus. I checked other applications (Fork, default Windows notepad) and they move focus to the top menu when we press Alt. So they have similar issue, when we return to the application again.
But Swing/Compose applications don't have top menu by default
Window 10 consumes Alt
if press Tab
after it. Windows 11 seems doesn't consume it
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
Compose 1.0.0-beta3, Windows 11
Result: content isn't scrolling.