mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-22 15:15:38 +00:00
Fixes an issue on macOS where having unprocessed events on the event queue on startup (mouse movements, etc.) would put the app in a partially-activated state and not take window focus (#732)
This commit is contained in:
parent
f3c545eef1
commit
8ec577b9ca
|
@ -100,6 +100,9 @@ namespace OpenTK.Platform.MacOS
|
|||
[DllImport(LibObjC, EntryPoint="objc_msgSend")]
|
||||
public extern static void SendVoid(IntPtr receiver, IntPtr selector, uint uint1);
|
||||
|
||||
[DllImport(LibObjC, EntryPoint="objc_msgSend")]
|
||||
public extern static void SendVoid(IntPtr receiver, IntPtr selector, uint uint1, IntPtr intPtr1);
|
||||
|
||||
[DllImport(LibObjC, EntryPoint="objc_msgSend")]
|
||||
public extern static void SendVoid(IntPtr receiver, IntPtr selector, IntPtr intPtr1);
|
||||
|
||||
|
|
|
@ -57,6 +57,7 @@ namespace OpenTK.Platform.MacOS
|
|||
|
||||
// Setup the application
|
||||
Cocoa.SendBool(Handle, Selector.Get("setActivationPolicy:"), (int)NSApplicationActivationPolicy.Regular);
|
||||
Cocoa.SendVoid(Handle, Selector.Get("discardEventsMatchingMask:beforeEvent:"), uint.MaxValue, IntPtr.Zero);
|
||||
Cocoa.SendVoid(Handle, Selector.Get("activateIgnoringOtherApps:"), true);
|
||||
|
||||
if (Cocoa.SendIntPtr(Handle, Selector.Get("mainMenu")) == IntPtr.Zero)
|
||||
|
|
Loading…
Reference in a new issue