mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
Fix: Brightness and Volume Control
This commit is contained in:
parent
f4bcb96906
commit
98c826aaae
11 changed files with 340 additions and 97 deletions
|
|
@ -72,23 +72,30 @@ class SettingsWindowController: NSWindowController {
|
|||
|
||||
// If window is already visible, bring it to front properly
|
||||
if window?.isVisible == true {
|
||||
NSApp.activate(ignoringOtherApps: true)
|
||||
window?.orderFrontRegardless()
|
||||
window?.makeKeyAndOrderFront(nil)
|
||||
forceWindowToFront()
|
||||
return
|
||||
}
|
||||
|
||||
// Show the window with proper ordering
|
||||
window?.center()
|
||||
forceWindowToFront()
|
||||
}
|
||||
|
||||
private func forceWindowToFront() {
|
||||
// Multi-step approach to ensure window gets focus
|
||||
window?.orderFrontRegardless()
|
||||
window?.makeKeyAndOrderFront(nil)
|
||||
window?.center()
|
||||
|
||||
// Activate the app and ensure window gets focus
|
||||
// Activate the app with maximum priority
|
||||
NSApp.activate(ignoringOtherApps: true)
|
||||
|
||||
// Force window to front after activation
|
||||
DispatchQueue.main.async { [weak self] in
|
||||
self?.window?.makeKeyAndOrderFront(nil)
|
||||
// Double-check after a brief delay
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { [weak self] in
|
||||
guard let window = self?.window else { return }
|
||||
if !window.isKeyWindow {
|
||||
window.makeKeyAndOrderFront(nil)
|
||||
NSApp.activate(ignoringOtherApps: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue