[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] graphics freeze when mouse click occurs on windows



On Tue, 2005-04-05 at 05:19 +0200, Alexander Duesel wrote:
> It's just Python, Pygame and no mouse - but the code is a 
> bit messy so the bug might be in the Python code not in 
> WindowsXP... There is a lot of pygame.display.update() 
> from different threads and key handling runs in an extra 
> thread.

This is your problem. The pygame display is not thread safe at all. It
can only be accessed from the program's primary thread. The different
display backends will expose different kinds of wierd problems with this
happens.

You are able to post new events from secondary threads, but only the
primary thread should call the event functions to get, clear, or pump
the queue.