Merge pull request #691 from SparkusK/develop
Stop taking X locks on display when attempting MakeCurrent() calls.
This commit is contained in:
commit
19f81efc89
1 changed files with 9 additions and 20 deletions
|
@ -319,14 +319,12 @@ namespace OpenTK.Platform.X11
|
|||
Handle, System.Threading.Thread.CurrentThread.ManagedThreadId, Display));
|
||||
|
||||
bool result;
|
||||
using (new XLock(Display))
|
||||
{
|
||||
result = Glx.MakeCurrent(Display, IntPtr.Zero, IntPtr.Zero);
|
||||
if (result)
|
||||
{
|
||||
currentWindow = null;
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Print("{0}", result ? "done!" : "failed.");
|
||||
}
|
||||
else
|
||||
|
@ -342,14 +340,11 @@ namespace OpenTK.Platform.X11
|
|||
throw new InvalidOperationException("Invalid display, window or context.");
|
||||
}
|
||||
|
||||
using (new XLock(Display))
|
||||
{
|
||||
result = Glx.MakeCurrent(Display, w.Handle, Handle);
|
||||
if (result)
|
||||
{
|
||||
currentWindow = w;
|
||||
}
|
||||
}
|
||||
|
||||
if (!result)
|
||||
{
|
||||
|
@ -367,13 +362,10 @@ namespace OpenTK.Platform.X11
|
|||
public override bool IsCurrent
|
||||
{
|
||||
get
|
||||
{
|
||||
using (new XLock(Display))
|
||||
{
|
||||
return Glx.GetCurrentContext() == Handle.Handle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override int SwapInterval
|
||||
{
|
||||
|
@ -487,12 +479,9 @@ namespace OpenTK.Platform.X11
|
|||
IntPtr display = Display;
|
||||
|
||||
if (IsCurrent)
|
||||
{
|
||||
using (new XLock(display))
|
||||
{
|
||||
Glx.MakeCurrent(display, IntPtr.Zero, IntPtr.Zero);
|
||||
}
|
||||
}
|
||||
using (new XLock(display))
|
||||
{
|
||||
Glx.DestroyContext(display, Handle);
|
||||
|
|
Loading…
Reference in a new issue