From c6ed3a0fac619580d8785df54c9b40bca2501bcf Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Thu, 9 Aug 2007 12:14:00 +0000 Subject: [PATCH] Fixed X11GLContext.MakeCurrent. X11GLControl was not setting the handle correctly. --- Source/OpenTK/Platform/X11/WindowInfo.cs | 5 +++-- Source/OpenTK/Platform/X11/X11GLContext.cs | 5 +++-- Source/OpenTK/Platform/X11/X11GLControl.cs | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Source/OpenTK/Platform/X11/WindowInfo.cs b/Source/OpenTK/Platform/X11/WindowInfo.cs index 039da219..0e8fb81c 100644 --- a/Source/OpenTK/Platform/X11/WindowInfo.cs +++ b/Source/OpenTK/Platform/X11/WindowInfo.cs @@ -16,13 +16,14 @@ namespace OpenTK.Platform.X11 } internal WindowInfo(WindowInfo parent) - { + { + this.Handle = parent.Handle; this.TopLevelWindow = parent.TopLevelWindow; this.Screen = parent.Screen; this.Display = parent.Display; this.RootWindow = parent.RootWindow; this.VisualInfo = parent.VisualInfo; - this.Parent = parent; + this.Parent = parent; } private IntPtr rootWindow, handle, topLevelWindow, display; diff --git a/Source/OpenTK/Platform/X11/X11GLContext.cs b/Source/OpenTK/Platform/X11/X11GLContext.cs index a591a7c4..57472efb 100644 --- a/Source/OpenTK/Platform/X11/X11GLContext.cs +++ b/Source/OpenTK/Platform/X11/X11GLContext.cs @@ -69,10 +69,11 @@ namespace OpenTK.Platform.X11 { Debug.Write( String.Format( - "Making context {0} current on thread {1} (display: {2}, window: {3})... ", + "Making context {0} current on thread {1} (Display: {2}, Screen: {3}, Window: {4})... ", x11context, System.Threading.Thread.CurrentThread.ManagedThreadId, - windowInfo.Display, + windowInfo.Display, + windowInfo.Screen, windowInfo.Handle ) ); diff --git a/Source/OpenTK/Platform/X11/X11GLControl.cs b/Source/OpenTK/Platform/X11/X11GLControl.cs index 79366556..7505ecff 100644 --- a/Source/OpenTK/Platform/X11/X11GLControl.cs +++ b/Source/OpenTK/Platform/X11/X11GLControl.cs @@ -67,9 +67,9 @@ namespace OpenTK.Platform.X11 System.Reflection.BindingFlags.NonPublic).GetValue(null); Debug.Print( - "Screen: {0}, Display: {1}, Root Window: {2}, Control: {3}", + "Screen: {0}, Display: {1}, Root Window: {2}, Handle: {3}", info.Screen, info.Display, info.RootWindow, info.Handle); - + glContext = new X11GLContext(info, mode); info.VisualInfo = glContext.CreateVisual();