From ce23ae19c8824027956bc7e1269ef92f51365260 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Sun, 5 Aug 2007 19:04:06 +0000 Subject: [PATCH] Improved WindowInfo.ToString. Added window mapping for X11Input. Changed the notification mask for X11GLNative --- Source/OpenTK/Platform/X11/WindowInfo.cs | 2 +- Source/OpenTK/Platform/X11/X11GLNative.cs | 18 +++++++----------- Source/OpenTK/Platform/X11/X11Input.cs | 4 +++- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Source/OpenTK/Platform/X11/WindowInfo.cs b/Source/OpenTK/Platform/X11/WindowInfo.cs index af7b7539..62d3dd47 100644 --- a/Source/OpenTK/Platform/X11/WindowInfo.cs +++ b/Source/OpenTK/Platform/X11/WindowInfo.cs @@ -37,7 +37,7 @@ namespace OpenTK.Platform.X11 public override string ToString() { - return String.Format("X11.WindowInfo: Display {0}, Screen {1}, Handle {2}, Parent {3}", + return String.Format("X11.WindowInfo: Display {0}, Screen {1}, Handle {2}, Parent: ({3})", this.Display, this.Screen, this.Handle, this.Parent != null ? this.Parent.ToString() : "null"); } } diff --git a/Source/OpenTK/Platform/X11/X11GLNative.cs b/Source/OpenTK/Platform/X11/X11GLNative.cs index 5f17cf7a..5e61d502 100644 --- a/Source/OpenTK/Platform/X11/X11GLNative.cs +++ b/Source/OpenTK/Platform/X11/X11GLNative.cs @@ -110,9 +110,9 @@ namespace OpenTK.Platform.X11 wnd_attributes.colormap = glContext.XColormap; //API.CreateColormap(display, rootWindow, glxVisualInfo.visual, 0/*AllocNone*/); wnd_attributes.event_mask = - EventMask.StructureNotifyMask | - EventMask.SubstructureNotifyMask | - EventMask.ExposureMask; + EventMask.StructureNotifyMask;// | + //EventMask.SubstructureNotifyMask | + //EventMask.ExposureMask; CreateWindowMask cw_mask = CreateWindowMask.CWBackPixel | @@ -126,10 +126,8 @@ namespace OpenTK.Platform.X11 0, 0, mode.Width, mode.Height, 0, - //glxVisualInfo.depth, glContext.XVisualInfo.depth, Constants.InputOutput, - //glxVisualInfo.visual, glContext.XVisualInfo.visual, cw_mask, wnd_attributes @@ -141,17 +139,16 @@ namespace OpenTK.Platform.X11 } Debug.WriteLine("done! (id: " + info.Handle + ")"); - +/* // Set the window hints - /* SizeHints hints = new SizeHints(); hints.x = 0; hints.y = 0; hints.width = 640; hints.height = 480; hints.flags = USSize | USPosition; - X11Api.SetNormalHints(display, window, hints); - X11Api.SetStandardProperties( + API.SetNormalHints(display, window, hints); + API.SetStandardProperties( display, window, name, @@ -161,10 +158,9 @@ namespace OpenTK.Platform.X11 0, hints ); - */ //glContext.ContainingWindow = info.Window; - +*/ glContext.windowInfo.Handle = info.Handle; glContext.CreateContext(null, true); diff --git a/Source/OpenTK/Platform/X11/X11Input.cs b/Source/OpenTK/Platform/X11/X11Input.cs index 6ec05e0a..c571bdd5 100644 --- a/Source/OpenTK/Platform/X11/X11Input.cs +++ b/Source/OpenTK/Platform/X11/X11Input.cs @@ -55,7 +55,7 @@ namespace OpenTK.Platform.X11 window.Display, window.Parent.Handle, 0, 0, - 1, 1, + 0, 0, 0, 0, Constants.InputOnly, window.VisualInfo.visual, @@ -68,6 +68,8 @@ namespace OpenTK.Platform.X11 throw new Exception("Could not create input window."); } + API.MapWindow(window.Display, window.Handle); + Debug.WriteLine("done! (id: " + window + ")"); // Select input events to be reported here.