picoe / Eto

Cross platform GUI framework for desktop and mobile applications in .NET
Other
3.52k stars 319 forks source link

Native Filepickers silently fail/don't appear when CurrentFilter is set #2632

Open Miepee opened 3 months ago

Miepee commented 3 months ago

Expected Behavior

File picker should appear

Actual Behavior

The file picker doesn't appear / seems to fail somewhere

Steps to Reproduce the Problem

  1. Use Linux (havent tested on other OS)
  2. Use either flatpak, or set the environmnent variable GTK_USE_PORTAL=1
  3. Call the below code

Code that Demonstrates the Problem

FileFilter filter = new FileFilter("Zip files", ".zip");
using OpenFileDialog fileFinder = new OpenFileDialog
{
    Filters = { filter },
    Title = title,
    CurrentFilter = filter,
    CheckFileExists = true,
};
fileFinder.ShowDialog();

Notes

Commenting out CurrentFilter works fine. I tried to investiage it a litle bit and the sisue Seems to be somewhere in GTKFileDialog.cs::SetFilters. It is getting called by ShowDialog. Setting a breakpoint on that call, reveals that after stepping over the function, it will never reach the next line (int result = Control.Run();). I am not sure what could cause this. It seems to choke somewhere on the AddFilter GTK# call, but I have no clue why.

Specifications