juliencegarra / OpenMATB

OpenMATB: A Multi-Attribute Task Battery promoting task customization, software extendability and experiment replicability
Other
43 stars 32 forks source link

Can't exit program after pause for too long with pyglet-gui #23

Closed thomakl closed 1 year ago

thomakl commented 1 year ago

Hi,

If I pause the program for too long (more than 20 sec), the mouse doesn't action any button on the program I am stuck.

Traceback (most recent call last):
  File "C:\Users\uername\Projets\openmatb\main.py", line 71, in <module>
    app = OpenMATB()
  File "C:\Users\uername\Projets\openmatb\main.py", line 68, in __init__
    self.scheduler.run()
  File "C:\Users\uername\Projets\openmatb\core\scheduler.py", line 261, in run
    self.event_loop.run()
  File "C:\Users\uername\Projets\openmatb\venv\lib\site-packages\pyglet\app\base.py", line 169, in run
    timeout = self.idle()
  File "C:\Users\uername\Projets\openmatb\venv\lib\site-packages\pyglet\app\base.py", line 245, in idle
    window.dispatch_event('on_draw')
  File "C:\Users\uername\Projets\openmatb\venv\lib\site-packages\pyglet\window\__init__.py", line 1352, in dispatch_event
    if EventDispatcher.dispatch_event(self, *args) != False:
  File "C:\Users\uername\Projets\openmatb\venv\lib\site-packages\pyglet\event.py", line 415, in dispatch_event
    if getattr(self, event_type)(*args):
  File "C:\Users\uername\Projets\openmatb\core\window.py", line 105, in on_draw
    self.batch.draw()
  File "C:\Users\uername\Projets\openmatb\venv\lib\site-packages\pyglet\graphics\__init__.py", line 564, in draw
    func()
  File "C:\Users\uername\Projets\openmatb\venv\lib\site-packages\pyglet\graphics\__init__.py", line 493, in <lambda>
    (lambda d, m: lambda: d.draw(m))(domain, mode))
  File "C:\Users\uername\Projets\openmatb\venv\lib\site-packages\pyglet\graphics\vertexdomain.py", line 292, in draw
    buffer.bind()
  File "C:\Users\uername\Projets\openmatb\venv\lib\site-packages\pyglet\graphics\vertexbuffer.py", line 390, in bind
    def bind(self):
KeyboardInterrupt

Cheers,

TL

benoitvalery commented 1 year ago

It seems to be a Windows related issue (no bug on Debian x64 Bullseye). Maybe something to do with the fulscreen mode, which is not handled correctly on Windows platforms. I try to come back soon with a solution.

benoitvalery commented 1 year ago

I @thomakl , the problem went from the pyglet_gui library. It seems that it does not handle properly mouse actions (same problem with a Mac). I decided to get rid of pyglet_gui library, and just propose keyboard based modal dialogs, which is much more robust. Test the last commit and if it resolves the problem, I will tag it to version 1.2.

thomakl commented 1 year ago

The problem seems to be resolved. Thank you for your time.