[AD] problem with shared current displays

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Recently I upgraded my X and now ex_native_filechooser doesn't work
correctly.

X Error of failed request:  BadAccess (attempt to access private resource denied)
  Major opcode of failed request:  150 (GLX)
  Minor opcode of failed request:  26 (X_GLXMakeContextCurrent)
  Serial number of failed request:  183
  Current serial number in output stream:  183

ex_native_filechooser makes one display current in two threads
simultaneously.  According to the GLX 1.4 documentation, the resulting
call to glXMakeContextCurrent() is behaving exactly as it should.
Somehow it didn't detect the incorrect usage in earlier versions.

The X port doesn't require the al_set_current_display() calls at all --
they were inserted for Windows.  I don't think having a display be
current in multiple threads is something we should be supporting, so we
need a different solution for Windows.


While researching this, I read on a mailing list post that you must
explicitly free a GLX context before making it current in another
thread.  I suggest that in Allegro, this means a thread should call
al_set_current_display(NULL); or al_set_current_display(other_display);
to give up its current display.

Peter




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/