Catalina Change app from Agent to Regular Issue

Hello,


I have an App when I set LSUIElement to Yes in info.plist and I programmaticaly change the App type from Agent to Regular using

[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];


This technique allow me to start my app as an Agent App then change it to Regular App depending on user preferences or input.


I start experementing issues in Catalina: When I call NSApp setActivationPolicy:NSApplicationActivationPolicyRegular] menu and Dock icon show up but Menus get disabled and unclickable. As a User I have to click on Dock Icon to activate Menus.


I force the focus using

[[NSApplication sharedApplication] activateIgnoringOtherApps:true] with no result.


@implementation AppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
   
    [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; //change app type to regular
    [[NSApplication sharedApplication] activateIgnoringOtherApps:true];
   
 
}


Moreover, my app continue to catch mouse event

- (void)sendEventNSEvent *)event {
    NSLog(@"%@", event);
    [super sendEvent:event];
}


It's work on previous MacOS versions: Mojave, High Sierra and Sierra


Is it a Catalina bug or something was changed in the meantime?

Thanks in advance.