mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-03 16:46:55 +00:00
Merge pull request #691 from SparkusK/develop
Stop taking X locks on display when attempting MakeCurrent() calls.
This commit is contained in:
commit
19f81efc89
|
@ -319,14 +319,12 @@ namespace OpenTK.Platform.X11
|
||||||
Handle, System.Threading.Thread.CurrentThread.ManagedThreadId, Display));
|
Handle, System.Threading.Thread.CurrentThread.ManagedThreadId, Display));
|
||||||
|
|
||||||
bool result;
|
bool result;
|
||||||
using (new XLock(Display))
|
result = Glx.MakeCurrent(Display, IntPtr.Zero, IntPtr.Zero);
|
||||||
|
if (result)
|
||||||
{
|
{
|
||||||
result = Glx.MakeCurrent(Display, IntPtr.Zero, IntPtr.Zero);
|
currentWindow = null;
|
||||||
if (result)
|
|
||||||
{
|
|
||||||
currentWindow = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.Print("{0}", result ? "done!" : "failed.");
|
Debug.Print("{0}", result ? "done!" : "failed.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -342,13 +340,10 @@ namespace OpenTK.Platform.X11
|
||||||
throw new InvalidOperationException("Invalid display, window or context.");
|
throw new InvalidOperationException("Invalid display, window or context.");
|
||||||
}
|
}
|
||||||
|
|
||||||
using (new XLock(Display))
|
result = Glx.MakeCurrent(Display, w.Handle, Handle);
|
||||||
|
if (result)
|
||||||
{
|
{
|
||||||
result = Glx.MakeCurrent(Display, w.Handle, Handle);
|
currentWindow = w;
|
||||||
if (result)
|
|
||||||
{
|
|
||||||
currentWindow = w;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!result)
|
if (!result)
|
||||||
|
@ -368,10 +363,7 @@ namespace OpenTK.Platform.X11
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
using (new XLock(Display))
|
return Glx.GetCurrentContext() == Handle.Handle;
|
||||||
{
|
|
||||||
return Glx.GetCurrentContext() == Handle.Handle;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -488,10 +480,7 @@ namespace OpenTK.Platform.X11
|
||||||
|
|
||||||
if (IsCurrent)
|
if (IsCurrent)
|
||||||
{
|
{
|
||||||
using (new XLock(display))
|
Glx.MakeCurrent(display, IntPtr.Zero, IntPtr.Zero);
|
||||||
{
|
|
||||||
Glx.MakeCurrent(display, IntPtr.Zero, IntPtr.Zero);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
using (new XLock(display))
|
using (new XLock(display))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue