Hacker News new | ask | show | jobs
by whizzter 2044 days ago
Sounds more like an IDEA bug rather than a Swing bug. I've implemented an editing tool (realtime video generation parameter editing w/ feedback from the generator) that really has a lot of issues.

Part of them because i didn't fully understand Swing when i began the project and partly because synchronizing GUI's to another live process is a quite error prone task.

A debugger process is almost certainly not living in the same thread as the Swing UI of IDEA so this almost surely more of a thread synchroniztion issue rather than Swing issue. (You really don't watch to do any cross-thread touching with Swing apart from for a very limited set of components built for this).

1 comments

Yes it's certainly something to do with threads. Still the way it manifests is weird. For example sometimes in apps like Chrome or Firefox the tab bar will freeze momentarily while the UI is hung waiting for something, however if you click something like a tab close button during this period your click will be processed once the UI un-hangs.

In intelliJ it was like whenever the UI was not immediately responding to mouse events, it would often just lose the event instead of it being correctly processed once the UI thread was freed up.

Chrome/FF in this case has an UI thread that becomes unresponsive for whatever reason and doesn't empty it's message-queue (that contains the mouse/keyboard/etc events).

In the case of IntelliJ there is probably some of their code accepting the event and then probably has some ad-hoc message passing by setting a field that is polled by the receiver thread under the assumption that the receiver always runs faster than a human can act, however as soon as that assumption is broken by some pause you get what you describe.