Skip to content

armgit / Filee

Public Imported from GitHub
0

Free, open-source file converter. Convert 263 formats offline by drag & drop — images, PDF, Word, Excel, PowerPoint, HWP/HWPX, video, audio, e-books and archives. No upload, no Office needed.

macOS: ask for Accessibility once the main window is up, so the alert isn't hidden behind it

KnifeLemon756ad7750266
diff --git a/src/Filee.App/App.axaml.cs b/src/Filee.App/App.axaml.cs
index 4e93f277..f420dded 100644
--- a/src/Filee.App/App.axaml.cs
+++ b/src/Filee.App/App.axaml.cs
@@ -77,11 +77,16 @@ public partial class App : Application
triggers.Start();
log.LogInformation("Filee {Version} started", UpdateService.CurrentVersion);
// macOS: ask for Accessibility with the system's own alert when the user opened Filee (not at sign-in) and
- // a drag gesture is on. The home page keeps a reminder until it is given.
+ // a drag gesture is on. The home page keeps a reminder until it is given. Asked once the main window is up:
+ // asked earlier, the alert ends up behind it.
if (OperatingSystem.IsMacOS() && triggers.NeedsPermission && !Program.Options.Background
&& platform is Filee.Platform.MacOS.MacOSPlatformServices mac
&& store.Settings.Triggers.Any(t => t.Enabled && t.Kind == TriggerKind.Drag))
- mac.RequestAccessibilityPermission();
+ DispatcherTimer.RunOnce(() =>
+ {
+ if (triggers.NeedsPermission)
+ mac.RequestAccessibilityPermission();
+ }, TimeSpan.FromSeconds(1.5));
store.SettingsChanged += (_, _) => ApplySettings(store.Settings);