sciapp / gr

GR framework: a graphics library for visualisation applications
Other
328 stars 54 forks source link

GR creates one window per frame #113

Closed mantielero closed 4 years ago

mantielero commented 4 years ago

This is a bug but not very easy to reproduce. I already faced this problem and reported it in https://github.com/sciapp/gr/issues/112

I think it might appear when several windows are open at the same time.

For instance, I have the dual pendulum example compiled. The binary behaves as expected, but when I run it and I execute the python version in parallel, plenty of windows appear.

It is like if both processes weren't completely issolated.

mantielero commented 4 years ago

I think one way to reproduce it is:

  1. Open two terminals
  2. Run: python pendulum.py in both terminals at the same time.
FlorianRhiem commented 4 years ago

What operating system are you using?

mantielero commented 4 years ago

I am using Linux (ArchLinux) and gr-framework 0.48.0.

FlorianRhiem commented 4 years ago

The gksqt application gets started by GR and then GR connects to it using sockets. If one instance of GR has already launched gksqt, a second cannot and will instead connect to the running one. However, previously this lead to a reconnect in the second instance as it couldn't know whether or not gksqt was (still) running. This is now fixed on develop so that GR will assume that gksqt stays running until there are any issues with sending or receiving data using the socket. In that case, it will do a reconnect. This isn't perfect, but until the networking logic is redone for gksqt etc, it should work well enough.

FlorianRhiem commented 4 years ago

The change was included in the last release (GR runtime 0.49.0 / Python wrapper 1.14.0). Could you please test whether the issue still occurs for you?

mantielero commented 4 years ago

Now it works with 0.49. Thanks a lot.