mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-23 07:15:28 +00:00
Corrected the OnCreate infinite loop between X11GLNative and X11Input.
This commit is contained in:
parent
ad97683c80
commit
22c3eb187f
|
@ -49,13 +49,15 @@ namespace OpenTK
|
|||
}
|
||||
|
||||
glWindow.Resize += new ResizeEvent(glWindow_Resize);
|
||||
glWindow.Create += new CreateEvent(glWindow_Create);
|
||||
glWindow.Create += new CreateEvent(glWindow_CreateInputDriver);
|
||||
}
|
||||
|
||||
void glWindow_Create(object sender, EventArgs e)
|
||||
void glWindow_CreateInputDriver(object sender, EventArgs e)
|
||||
{
|
||||
//glWindow.Context.MakeCurrent();
|
||||
|
||||
driver = new InputDriver(this.WindowInfo);
|
||||
glWindow.Create -= glWindow_CreateInputDriver;
|
||||
|
||||
this.OnCreate(e);
|
||||
}
|
||||
|
|
|
@ -63,10 +63,13 @@ namespace OpenTK.Platform.X11
|
|||
Display display,
|
||||
Window parent,
|
||||
int x, int y,
|
||||
uint width, uint height,
|
||||
uint border_width,
|
||||
//uint width, uint height,
|
||||
int width, int height,
|
||||
//uint border_width,
|
||||
int border_width,
|
||||
int depth,
|
||||
uint @class,
|
||||
//uint @class,
|
||||
int @class,
|
||||
IntPtr visual,
|
||||
[MarshalAs(UnmanagedType.SysUInt)] CreateWindowMask valuemask,
|
||||
SetWindowAttributes attributes
|
||||
|
|
|
@ -124,7 +124,7 @@ namespace OpenTK.Platform.X11
|
|||
info.Display,
|
||||
info.RootWindow,
|
||||
0, 0,
|
||||
640, 480,
|
||||
mode.Width, mode.Height,
|
||||
0,
|
||||
//glxVisualInfo.depth,
|
||||
glContext.XVisualInfo.depth,
|
||||
|
@ -226,19 +226,15 @@ namespace OpenTK.Platform.X11
|
|||
{
|
||||
case EventType.ReparentNotify:
|
||||
API.NextEvent(info.Display, reparent);
|
||||
// Do nothing
|
||||
|
||||
// TODO: Is there a more suitable place to raise the Create event?
|
||||
// ReparentNotify seems to be the first event raised on window creation.
|
||||
this.OnCreate(EventArgs.Empty);
|
||||
break;
|
||||
|
||||
case EventType.CreateNotify:
|
||||
API.NextEvent(info.Display, createWindow);
|
||||
|
||||
// Set window width/height
|
||||
mode.Width = createWindow.width;
|
||||
mode.Height = createWindow.height;
|
||||
this.OnCreate(EventArgs.Empty);
|
||||
Debug.WriteLine(
|
||||
String.Format("OnCreate fired: {0}x{1}", mode.Width, mode.Height)
|
||||
);
|
||||
// A child was created - nothing to do
|
||||
break;
|
||||
|
||||
case EventType.DestroyNotify:
|
||||
|
@ -288,6 +284,7 @@ namespace OpenTK.Platform.X11
|
|||
if (this.Create != null)
|
||||
{
|
||||
this.Create(this, e);
|
||||
Debug.Print("OnCreate fired, from window: {0}", info.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue