mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-23 07:25:28 +00:00
MacOS: Fix event from user clicking close box to properly report that window doesn't exist anymore.
This commit is contained in:
parent
8bd20009b2
commit
dad798d41d
|
@ -700,18 +700,18 @@ namespace OpenTK.Platform.MacOS.Carbon
|
|||
{
|
||||
IntPtr windowTarget = GetWindowEventTarget(windowRef);
|
||||
|
||||
Debug.Print("Window: {0}", windowRef);
|
||||
Debug.Print("Window Target: {0}", windowTarget);
|
||||
Debug.Print("Handler: {0}", uppHandlerProc);
|
||||
Debug.Print("Num Events: {0}", eventTypes.Length);
|
||||
Debug.Print("User Data: {0}", userData);
|
||||
Debug.Print("Handler Ref: {0}", handlerRef);
|
||||
//Debug.Print("Window: {0}", windowRef);
|
||||
//Debug.Print("Window Target: {0}", windowTarget);
|
||||
//Debug.Print("Handler: {0}", uppHandlerProc);
|
||||
//Debug.Print("Num Events: {0}", eventTypes.Length);
|
||||
//Debug.Print("User Data: {0}", userData);
|
||||
//Debug.Print("Handler Ref: {0}", handlerRef);
|
||||
|
||||
OSStatus error = _InstallEventHandler(windowTarget, uppHandlerProc,
|
||||
eventTypes.Length, eventTypes,
|
||||
userData, handlerRef);
|
||||
|
||||
Debug.Print("Status: {0}", error);
|
||||
//Debug.Print("Status: {0}", error);
|
||||
|
||||
if (error != OSStatus.NoError)
|
||||
{
|
||||
|
|
|
@ -52,6 +52,7 @@ namespace OpenTK.Platform.MacOS
|
|||
string title = "OpenTK Window";
|
||||
Rectangle bounds, windowedBounds, clientRectangle;
|
||||
bool mIsDisposed = false;
|
||||
bool mExists = true;
|
||||
|
||||
WindowAttributes mWindowAttrib;
|
||||
WindowClass mWindowClass;
|
||||
|
@ -112,6 +113,7 @@ namespace OpenTK.Platform.MacOS
|
|||
Debug.Print("Disposing of CarbonGLNative window.");
|
||||
|
||||
mIsDisposed = true;
|
||||
mExists = false;
|
||||
|
||||
if (disposing)
|
||||
{
|
||||
|
@ -289,8 +291,8 @@ namespace OpenTK.Platform.MacOS
|
|||
return OSStatus.EventNotHandled;
|
||||
}
|
||||
|
||||
EventInfo evt = new EventInfo(inEvent);
|
||||
CarbonGLNative window = (CarbonGLNative)reference.Target;
|
||||
CarbonGLNative window = (CarbonGLNative)reference.Target;
|
||||
EventInfo evt = new EventInfo(inEvent);
|
||||
|
||||
//Debug.Print("Processing {0} event for {1}.", evt, window.window);
|
||||
|
||||
|
@ -366,7 +368,8 @@ namespace OpenTK.Platform.MacOS
|
|||
return OSStatus.EventNotHandled;
|
||||
|
||||
case WindowEventKind.WindowClosed:
|
||||
OnClosed();
|
||||
mExists = false;
|
||||
OnClosed();
|
||||
|
||||
return OSStatus.NoError;
|
||||
|
||||
|
@ -639,7 +642,7 @@ namespace OpenTK.Platform.MacOS
|
|||
|
||||
public bool Exists
|
||||
{
|
||||
get { return !mIsDisposed; }
|
||||
get { return mExists; }
|
||||
}
|
||||
|
||||
public IWindowInfo WindowInfo
|
||||
|
|
Loading…
Reference in a new issue