From 00e89c33603f60edaa3ce77b671f1160942c98d8 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Sat, 15 May 2021 14:04:39 +0700 Subject: [PATCH] Fix issue with the app blocking access to the desktop It seems like the native SwiftUI window is there even if not shown and somehow it sometimes consumes the mouse events. Fixes #10 --- Color Picker/AppState.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Color Picker/AppState.swift b/Color Picker/AppState.swift index 6caee3b..3612845 100644 --- a/Color Picker/AppState.swift +++ b/Color Picker/AppState.swift @@ -75,6 +75,9 @@ final class AppState: ObservableObject { ) DispatchQueue.main.async { [self] in + // Make the invisible native SwitUI window not block access to the desktop. + NSApp.windows.first?.ignoresMouseEvents = true + setUpEvents() showWelcomeScreenIfNeeded() }