From 015acba313e82b9ab36134e970dd8e0e7d9936cc Mon Sep 17 00:00:00 2001 From: thefiddler Date: Wed, 16 Jul 2014 14:51:14 +0200 Subject: [PATCH] [KMS] Implemented INativeWindow.PointToClient/Screen --- Source/OpenTK/Platform/Linux/LinuxNativeWindow.cs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/Source/OpenTK/Platform/Linux/LinuxNativeWindow.cs b/Source/OpenTK/Platform/Linux/LinuxNativeWindow.cs index d27557d..c1f9cdd 100644 --- a/Source/OpenTK/Platform/Linux/LinuxNativeWindow.cs +++ b/Source/OpenTK/Platform/Linux/LinuxNativeWindow.cs @@ -241,14 +241,27 @@ namespace OpenTK.Platform.Linux public override Point PointToClient(Point point) { - // Todo - return point; + var origin = Point.Empty; + var display = DisplayDevice.Default; + if (display != null) + { + origin = display.Bounds.Location; + } + var client = Location; + return new Point(point.X + client.X - origin.X, point.Y + client.Y - origin.Y); } public override Point PointToScreen(Point point) { - // Todo - return point; + var origin = Point.Empty; + var display = DisplayDevice.Default; + if (display != null) + { + origin = display.Bounds.Location; + } + var client = Location; + return new Point(point.X + origin.X - client.X, point.Y + origin.Y - client.Y); + } protected override void Dispose(bool disposing) -- 2.7.4