question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when call OpenFileDialog on osx and linux

See original GitHub issue

When I load OpenFileDialog on osx and Ubuntu, it has some problem. I use the following code to load OpenFileDialog:

var task = Task.Run(() =>
{
    OpenFileDialog openFileDialog = new OpenFileDialog
    {
        AllowMultiple = true
    };
    var outPathStrings = openFileDialog.ShowAsync();
    return outPathStrings;
});
var filelistStrings = task.GetAwaiter().GetResult();

It works normal on Windows. But when I run it on osx, it shows you are calling a method that can only be invoked from the UI thread. And on Ubuntu, it says GtkDialog mapped without a transient parent. This is discouraged.. And they all have no more response.

I think it may be because I did not load a MainWindow. I use the following code to start the application:

 var app = new Application();
AppBuilder.Configure(app)
    .UsePlatformDetect()
    .SetupWithoutStarting();

I want to know what is the actual reason for the problem and if I can use some way to avoid the problem.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
kekekekscommented, Sep 30, 2018

@grokys I think we should make window parameter here mandatory. Right now it’s too error-prone to use, since not passing the parent window is too forgiving on Win32 which is the most common developer platform.

0reactions
kekekekscommented, Oct 3, 2018

It’s fine to pass null as window, just don’t expect the dialog to show at any meaningful location (like on top of your window).

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Answer File" open file dialog not working for Mac Build
I notice that the "Answer File" no longer works in my Mac build, which I made for the Mac App Store. I'm not...
Read more >
What could cause an open file dialog window in Tkinter ...
The dialog goes away for me. When the dialog shows up, are you clicking on the "open" button? Clicking on "open" or double-clicking...
Read more >
macos - Enter a filename in the File Open dialog
I tried just typing into an open dialog but it will just try to "Go to a folder", it won't accept a full...
Read more >
Crash during open file dialog when trying to upload a file
2.In the file dialog window that pops up, navigate to a directory and/or select a file to upload 3.Chrome crashes with a segmentation...
Read more >
"Open File" dialog box takes a long time to appear on all ...
The problem turned out to be the shared drives: The file dialog process scans the shared drives before showing the file dialog window....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found