mirror of https://github.com/procxx/kepka.git
improved window activation in os x
This commit is contained in:
parent
1b16064db6
commit
afac237f03
|
@ -564,7 +564,9 @@ void psClearInitLogs() {
|
|||
}
|
||||
|
||||
void psActivateProcess(uint64 pid) {
|
||||
objc_activateProgram();
|
||||
if (!pid) {
|
||||
objc_activateProgram(App::wnd() ? App::wnd()->winId() : 0);
|
||||
}
|
||||
}
|
||||
|
||||
QString psCurrentCountry() {
|
||||
|
|
|
@ -73,7 +73,7 @@ void objc_execTelegram();
|
|||
|
||||
void objc_registerCustomScheme();
|
||||
|
||||
void objc_activateProgram();
|
||||
void objc_activateProgram(WId winId);
|
||||
bool objc_moveFile(const QString &from, const QString &to);
|
||||
void objc_deleteDir(const QString &dir);
|
||||
|
||||
|
|
|
@ -982,8 +982,12 @@ void objc_execTelegram() {
|
|||
_execUpdater(NO);
|
||||
}
|
||||
|
||||
void objc_activateProgram() {
|
||||
void objc_activateProgram(WId winId) {
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
if (winId) {
|
||||
NSWindow *w = [reinterpret_cast<NSView*>(winId) window];
|
||||
[w makeKeyAndOrderFront:NSApp];
|
||||
}
|
||||
}
|
||||
|
||||
bool objc_moveFile(const QString &from, const QString &to) {
|
||||
|
|
Loading…
Reference in New Issue