From f9fdddea645dc06b29d9b095cee73ef276f47ff6 Mon Sep 17 00:00:00 2001 From: "Stefanos A." Date: Wed, 13 Nov 2013 18:25:49 +0100 Subject: [PATCH] Re-added WindowHandle property There are projects that use reflection to access *WindowInfo.WindowHandle directly. This change ensures we don't break them. --- Source/OpenTK/Platform/MacOS/CarbonWindowInfo.cs | 7 ++++++- Source/OpenTK/Platform/Windows/WinWindowInfo.cs | 5 +++++ Source/OpenTK/Platform/X11/X11WindowInfo.cs | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Source/OpenTK/Platform/MacOS/CarbonWindowInfo.cs b/Source/OpenTK/Platform/MacOS/CarbonWindowInfo.cs index 8f5c88ce..717a6c58 100644 --- a/Source/OpenTK/Platform/MacOS/CarbonWindowInfo.cs +++ b/Source/OpenTK/Platform/MacOS/CarbonWindowInfo.cs @@ -70,6 +70,7 @@ namespace OpenTK.Platform.MacOS public IntPtr Handle { get { return this.windowRef; } + set { this.windowRef = value; } } internal bool GoFullScreenHack @@ -83,7 +84,6 @@ namespace OpenTK.Platform.MacOS set { goWindowedHack = value; } } - /// /// Gets a value indicating whether this instance refers to a System.Windows.Forms.Control. /// @@ -99,6 +99,11 @@ namespace OpenTK.Platform.MacOS return String.Format("MacOS.CarbonWindowInfo: Handle {0}", this.Handle); } + // For compatibility with whoever thought it would be + // a good idea to access internal APIs through reflection + // (e.g. MonoGame) + public IntPtr WindowHandle { get { return Handle; } set { Handle = value; } } + #endregion #region IDisposable Members diff --git a/Source/OpenTK/Platform/Windows/WinWindowInfo.cs b/Source/OpenTK/Platform/Windows/WinWindowInfo.cs index 7e5d078c..7449b6f1 100644 --- a/Source/OpenTK/Platform/Windows/WinWindowInfo.cs +++ b/Source/OpenTK/Platform/Windows/WinWindowInfo.cs @@ -89,6 +89,11 @@ namespace OpenTK.Platform.Windows } } + // For compatibility with whoever thought it would be + // a good idea to access internal APIs through reflection + // (e.g. MonoGame) + public IntPtr WindowHandle { get { return Handle; } set { Handle = value; } } + #region public override string ToString() /// Returns a System.String that represents the current window. diff --git a/Source/OpenTK/Platform/X11/X11WindowInfo.cs b/Source/OpenTK/Platform/X11/X11WindowInfo.cs index 8a9ee817..740e51d2 100644 --- a/Source/OpenTK/Platform/X11/X11WindowInfo.cs +++ b/Source/OpenTK/Platform/X11/X11WindowInfo.cs @@ -91,6 +91,11 @@ namespace OpenTK.Platform.X11 /// Gets or sets the X11 EventMask. public EventMask EventMask { get { return eventMask; } set { eventMask = value; } } + // For compatibility with whoever thought it would be + // a good idea to access internal APIs through reflection + // (e.g. MonoGame) + public IntPtr WindowHandle { get { return Handle; } set { Handle = value; } } + #endregion #region --- IDisposable Members ---