Browse Source

Fix GTK file chooser to show network locations on Linux (#19855)

GTK file choosers default to local_only=TRUE, which hides network
locations (SMB, SFTP, NFS) mounted via GVFS. This change calls
gtk_file_chooser_set_local_only(FALSE) to enable network browsing.

Fixes browsing to network shares in OpenFileDialog, OpenFolderDialog,
and SaveFileDialog on Linux.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: meywd <meywd@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
release/11.3.8
Mahmoud Darwish 4 months ago
committed by Julien Lebosquain
parent
commit
9a6eea5b39
  1. 5
      src/Avalonia.X11/NativeDialogs/Gtk.cs
  2. 1
      src/Avalonia.X11/NativeDialogs/GtkNativeFileDialogs.cs

5
src/Avalonia.X11/NativeDialogs/Gtk.cs

@ -61,7 +61,10 @@ namespace Avalonia.X11.NativeDialogs
[DllImport(GtkName)]
public static extern void gtk_file_chooser_set_select_multiple(IntPtr chooser, bool allow);
[DllImport(GtkName)]
public static extern void gtk_file_chooser_set_local_only(IntPtr chooser, bool local_only);
[DllImport(GtkName)]
public static extern void gtk_file_chooser_set_do_overwrite_confirmation(IntPtr chooser, bool do_overwrite_confirmation);

1
src/Avalonia.X11/NativeDialogs/GtkNativeFileDialogs.cs

@ -87,6 +87,7 @@ namespace Avalonia.X11.NativeDialogs
}
gtk_window_set_modal(dlg, true);
gtk_file_chooser_set_local_only(dlg, false);
var tcs = new TaskCompletionSource<string[]?>();
List<IDisposable>? disposables = null;

Loading…
Cancel
Save