Changed the WindowInfo(WindowInfo parent) constructor to make the newly created window a child of the specified parent. This should be the last bug causing the NRE in X11Input.cs

This commit is contained in:
the_fiddler 2007-08-05 17:45:59 +00:00
parent ab1ec72170
commit 4c38950247
2 changed files with 6 additions and 1 deletions

View file

@ -17,7 +17,7 @@ namespace OpenTK.Platform.X11
this.Screen = parent.Screen; this.Screen = parent.Screen;
this.Display = parent.Display; this.Display = parent.Display;
this.RootWindow = parent.RootWindow; this.RootWindow = parent.RootWindow;
this.Handle = parent.Handle; this.Parent = parent;
} }
private IntPtr rootWindow, handle, topLevelWindow, display; private IntPtr rootWindow, handle, topLevelWindow, display;

View file

@ -28,6 +28,11 @@ namespace OpenTK.Platform.X11
Debug.WriteLine("Initalizing X11 input driver."); Debug.WriteLine("Initalizing X11 input driver.");
Debug.Indent(); Debug.Indent();
if (parent == null)
{
throw new ArgumentException("A valid parent window must be defined, in order to create an X11Input driver.");
}
Debug.WriteLine("Creating hidden input window."); Debug.WriteLine("Creating hidden input window.");
SetWindowAttributes wnd_attributes = new SetWindowAttributes(); SetWindowAttributes wnd_attributes = new SetWindowAttributes();