Fixed: notifications becomeActive and willActive were called even if the application was already active. The method run sends now an event CPAppKitDefined as in cocoa, this event will raise the notification becomeActive and willActive of the application when the application just finished to load

This commit is contained in:
Alexandre Wilhelm committed 2015-04-10 10:57:34 -07:00
1 parent 136138daab
commit 0dad10d6ab
1 file changed
+15
+15
View File
@@ -445,6 +445,9 @@ var CPMainCibFile = @"CPMainCibFile",
- (void)activateIgnoringOtherApps:(BOOL)shouldIgnoreOtherApps
{
if (_isActive)
return;
[self _willBecomeActive];
[CPPlatform activateIgnoringOtherApps:shouldIgnoreOtherApps];
@@ -455,6 +458,9 @@ var CPMainCibFile = @"CPMainCibFile",
- (void)deactivate
{
if (!_isActive)
return;
[self _willResignActive];
[CPPlatform deactivate];
@@ -480,6 +486,15 @@ var CPMainCibFile = @"CPMainCibFile",
- (void)run
{
[self finishLaunching];
[self sendEvent:[CPEvent otherEventWithType:CPAppKitDefined
location:CGPointMakeZero()
modifierFlags:0
timestamp:[CPEvent currentTimestamp]
windowNumber:[_keyWindow windowNumber]
context:nil
subtype:nil
data1:nil
data2:nil]];
}
// Managing the Event Loop