aboutsummaryrefslogtreecommitdiffhomepage
path: root/cocoa/ScintillaView.mm
diff options
context:
space:
mode:
Diffstat (limited to 'cocoa/ScintillaView.mm')
-rw-r--r--cocoa/ScintillaView.mm23
1 files changed, 23 insertions, 0 deletions
diff --git a/cocoa/ScintillaView.mm b/cocoa/ScintillaView.mm
index 1748cc40d..85eb81a1c 100644
--- a/cocoa/ScintillaView.mm
+++ b/cocoa/ScintillaView.mm
@@ -794,6 +794,17 @@ static void notification(intptr_t windowid, unsigned int iMessage, uintptr_t wPa
[self setGeneralProperty: SCI_INDICSETUNDER parameter: INPUT_INDICATOR value: 1];
[self setGeneralProperty: SCI_INDICSETSTYLE parameter: INPUT_INDICATOR value: INDIC_PLAIN];
[self setGeneralProperty: SCI_INDICSETALPHA parameter: INPUT_INDICATOR value: 100];
+
+ NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
+ [center addObserver:self
+ selector:@selector(applicationDidResignActive:)
+ name:NSApplicationDidResignActiveNotification
+ object:nil];
+
+ [center addObserver:self
+ selector:@selector(applicationDidBecomeActive:)
+ name:NSApplicationDidBecomeActiveNotification
+ object:nil];
}
return self;
}
@@ -809,6 +820,18 @@ static void notification(intptr_t windowid, unsigned int iMessage, uintptr_t wPa
//--------------------------------------------------------------------------------------------------
+- (void) applicationDidResignActive: (NSNotification *)note {
+ mBackend->ActiveStateChanged(false);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (void) applicationDidBecomeActive: (NSNotification *)note {
+ mBackend->ActiveStateChanged(true);
+}
+
+//--------------------------------------------------------------------------------------------------
+
- (void) viewDidMoveToWindow
{
[super viewDidMoveToWindow];