mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-26 06:26:11 -05:00
Correct macOS window activation from hidden state (#6575)
* Fix #6234 - properly set NSApplication activation policies when the window is hidden and shown
This commit is contained in:
parent
33bf6eb892
commit
11afd73117
@ -206,11 +206,10 @@
|
||||
|
||||
- (void) toggleForegroundApp:(bool) foreground
|
||||
{
|
||||
ProcessSerialNumber psn = {0, kCurrentProcess};
|
||||
if (foreground) {
|
||||
TransformProcessType(&psn, kProcessTransformToForegroundApplication);
|
||||
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
|
||||
} else {
|
||||
TransformProcessType(&psn, kProcessTransformToUIElementApplication);
|
||||
[NSApp setActivationPolicy:NSApplicationActivationPolicyProhibited];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -70,6 +70,7 @@ bool MacUtils::raiseWindow(WId pid)
|
||||
|
||||
bool MacUtils::raiseOwnWindow()
|
||||
{
|
||||
m_appkit->toggleForegroundApp(true);
|
||||
return m_appkit->activateProcess(m_appkit->ownProcessId());
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user