Changed: Windows focus events on macOS

feature/pre-code-move
Nimetu 5 years ago
parent dccbb376a0
commit 9c46a9d8f7

@ -700,6 +700,7 @@ public:
GfxMode _CurrentMode;
sint32 _WindowX;
sint32 _WindowY;
bool _WindowFocus;
#ifdef NL_OS_MAC
NLMISC::CCocoaEventEmitter _EventEmitter;
@ -723,7 +724,6 @@ private:
bool _Maximized;
uint _Interval;
bool _Resizable;
bool _WindowFocus;
sint32 _DecorationWidth;
sint32 _DecorationHeight;

@ -40,5 +40,7 @@ using NL3D::CDriverGL;
- (id)initWithDriver:(CDriverGL*)driver;
- (void)windowDidMove:(NSNotification*)notification;
- (void)windowDidBecomeKey:(NSNotification *)notification;
- (void)windowDidResignKey:(NSNotification *)notification;
@end

@ -55,4 +55,19 @@ static void windowDidMove(NSWindow* window, CDriverGL* driver)
windowDidMove([notification object], _driver);
}
- (void)windowDidBecomeKey:(NSNotification *)notification
{
if (!_driver)
return;
_driver->_WindowFocus = true;
}
- (void)windowDidResignKey:(NSNotification *)notification;
{
if(!_driver)
return;
_driver->_WindowFocus = false;
}
@end

Loading…
Cancel
Save