Skip to content

Commit af568b1

Browse files
Fenron-devclaude
andcommitted
Fix macOS file picker not appearing and Windows drag-and-drop freeze
- macOS: remove window minimize before FilePicker dialog — the NSOpenPanel handles z-order natively; minimizing caused the dialog to appear hidden in the dock (returns null, user sees nothing). The underlying window ordering issue was already fixed in the MainFlutterWindow.swift refactor. - Windows: delay _handleDrop by one frame after OLE DnD completes so Flutter can finish the drag message loop before pushing the import dialog, preventing the grey/frozen window state. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2387780 commit af568b1

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

lib/core/file_picker_helper.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ class FilePickerHelper {
1919

2020
static bool get _isDesktop =>
2121
Platform.isLinux || Platform.isWindows || Platform.isMacOS;
22-
static bool get _shouldMinimizeDesktopWindow =>
23-
Platform.isLinux || Platform.isMacOS;
22+
static bool get _shouldMinimizeDesktopWindow => Platform.isLinux;
2423

2524
static bool _effectiveLockParentWindow(bool lockParentWindow) =>
2625
lockParentWindow || Platform.isWindows;

lib/ui/widgets/drop_zone.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ class _DropZoneOverlayState extends ConsumerState<DropZoneOverlay> {
3232
onDragExited: (_) => setState(() => _isDragging = false),
3333
onDragDone: (detail) {
3434
setState(() => _isDragging = false);
35-
_handleDrop(detail.files);
35+
// Delay by one frame so Flutter can finish the OLE DnD message loop
36+
// on Windows before the dialog is pushed — without this the window
37+
// stays grey/frozen after the drop.
38+
WidgetsBinding.instance.addPostFrameCallback((_) {
39+
_handleDrop(detail.files);
40+
});
3641
},
3742
child: Stack(
3843
fit: StackFit.expand,

0 commit comments

Comments
 (0)