Use Qt signal for macOS Dock icon click event

This moves the Dock icon click reaction code to the common place and
allows some cleanup in obj_c code.

According to the Apple's docs `class_replaceMethod` behaves as
`class_addMethod`, if the method identified by name does not yet exist;
or as `method_setImplementation`, if it does exist.

Github-Pull: #14597
Rebased-From: 2464925e7b
This commit is contained in:
Hennadii Stepanov 2018-10-31 21:15:31 +02:00 committed by Anthony Fieroni
parent 5641252942
commit cce339ea42
2 changed files with 7 additions and 2 deletions

View file

@ -773,6 +773,12 @@ void BitcoinGUI::macosDockIconActivated()
show();
activateWindow();
}
#else
void BitcoinGUI::macosDockIconActivated()
{
show();
activateWindow();
}
#endif
void BitcoinGUI::optionsClicked()

View file

@ -49,5 +49,4 @@ void MacDockIconHandler::cleanup()
*/
void ForceActivation()
{
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
}
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];