mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-26 04:45:38 +00:00
* XI2Mouse.cs:
* X11Factory.cs: Removed window hooking, as it complicates code unnecessarily.
This commit is contained in:
parent
574909c426
commit
52d38059f4
|
@ -85,9 +85,9 @@ namespace OpenTK.Platform.X11
|
||||||
|
|
||||||
public virtual OpenTK.Input.IMouseDriver2 CreateMouseDriver()
|
public virtual OpenTK.Input.IMouseDriver2 CreateMouseDriver()
|
||||||
{
|
{
|
||||||
//if (XI2Mouse.IsSupported(IntPtr.Zero))
|
if (XI2Mouse.IsSupported(IntPtr.Zero))
|
||||||
// return new XI2Mouse(null); // Requires xorg 1.7 or higher.
|
return new XI2Mouse(); // Requires xorg 1.7 or higher.
|
||||||
//else
|
else
|
||||||
return new X11Mouse(); // Always supported.
|
return new X11Mouse(); // Always supported.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,23 +45,17 @@ namespace OpenTK.Platform.X11
|
||||||
static readonly Functions.EventPredicate PredicateImpl = IsEventValid;
|
static readonly Functions.EventPredicate PredicateImpl = IsEventValid;
|
||||||
readonly IntPtr Predicate = Marshal.GetFunctionPointerForDelegate(PredicateImpl);
|
readonly IntPtr Predicate = Marshal.GetFunctionPointerForDelegate(PredicateImpl);
|
||||||
|
|
||||||
// Can either attach itself to the specified window or can hook the root window.
|
public XI2Mouse()
|
||||||
public XI2Mouse(X11WindowInfo win)
|
|
||||||
{
|
{
|
||||||
if (win != null)
|
Debug.WriteLine("Using XI2Mouse.");
|
||||||
|
|
||||||
|
using (new XLock(API.DefaultDisplay))
|
||||||
{
|
{
|
||||||
window = win;
|
window = new X11WindowInfo();
|
||||||
}
|
window.Display = API.DefaultDisplay;
|
||||||
else
|
window.Screen = Functions.XDefaultScreen(window.Display);
|
||||||
{
|
window.RootWindow = Functions.XRootWindow(window.Display, window.Screen);
|
||||||
using (new XLock(API.DefaultDisplay))
|
window.WindowHandle = window.RootWindow;
|
||||||
{
|
|
||||||
window = new X11WindowInfo();
|
|
||||||
window.Display = API.DefaultDisplay;
|
|
||||||
window.Screen = Functions.XDefaultScreen(window.Display);
|
|
||||||
window.RootWindow = Functions.XRootWindow(window.Display, window.Screen);
|
|
||||||
window.WindowHandle = window.RootWindow;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsSupported(window.Display))
|
if (!IsSupported(window.Display))
|
||||||
|
@ -72,8 +66,6 @@ namespace OpenTK.Platform.X11
|
||||||
{
|
{
|
||||||
Functions.XISelectEvents(window.Display, window.WindowHandle, mask);
|
Functions.XISelectEvents(window.Display, window.WindowHandle, mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.WriteLine("Using XI2Mouse.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Checks whether XInput2 is supported on the specified display.
|
// Checks whether XInput2 is supported on the specified display.
|
||||||
|
@ -96,10 +88,7 @@ namespace OpenTK.Platform.X11
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region IMouseDriver Members
|
#region IMouseDriver2 Members
|
||||||
|
|
||||||
// Todo: remove this
|
|
||||||
public IList<MouseDevice> Mouse { get { throw new NotSupportedException(); } }
|
|
||||||
|
|
||||||
public MouseState GetState()
|
public MouseState GetState()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue