mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-24 05:59:37 -04: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
2 changed files with 3 additions and 3 deletions
|
@ -206,11 +206,10 @@
|
||||||
|
|
||||||
- (void) toggleForegroundApp:(bool) foreground
|
- (void) toggleForegroundApp:(bool) foreground
|
||||||
{
|
{
|
||||||
ProcessSerialNumber psn = {0, kCurrentProcess};
|
|
||||||
if (foreground) {
|
if (foreground) {
|
||||||
TransformProcessType(&psn, kProcessTransformToForegroundApplication);
|
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
|
||||||
} else {
|
} else {
|
||||||
TransformProcessType(&psn, kProcessTransformToUIElementApplication);
|
[NSApp setActivationPolicy:NSApplicationActivationPolicyProhibited];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,6 +70,7 @@ bool MacUtils::raiseWindow(WId pid)
|
||||||
|
|
||||||
bool MacUtils::raiseOwnWindow()
|
bool MacUtils::raiseOwnWindow()
|
||||||
{
|
{
|
||||||
|
m_appkit->toggleForegroundApp(true);
|
||||||
return m_appkit->activateProcess(m_appkit->ownProcessId());
|
return m_appkit->activateProcess(m_appkit->ownProcessId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue