Page 1 of 1

Download and Upload support for Linux

PostPosted: Thu Jul 25, 2019 12:38 am
by hari269
Hello All,

The current implementation of browser_window_std_gtk.cc has GetWindowHandle() code unimplemented for Linux with the comment " // There is no GtkWidget* representation of this object."

How do we implement the download and upload dialog box functionality for Linux?
Any suggestions/reference implementations will be helpful.

Thanks,
Harish

Re: Download and Upload support for Linux

PostPosted: Thu Jul 25, 2019 8:22 am
by magreenblatt
See cefclient/browser/dialog_handler_gtk.[cc|h].

Re: Download and Upload support for Linux

PostPosted: Thu Jul 25, 2019 11:22 pm
by hari269
Thanks for your response.

Currently, I see this in browser_window_std_gtk.cc file where NULL is returned.

ClientWindowHandle BrowserWindowStdGtk::GetWindowHandle() const {
REQUIRE_MAIN_THREAD();

// There is no GtkWidget* representation of this object.
NOTREACHED();
return NULL;
}

This is called in dialog_handler_gtk.cc which is printing the message " No GtkWindow for browser" as we are returning NULL in GetWindowHandle()

GtkWindow* GetWindow(CefRefPtr<CefBrowser> browser) {
scoped_refptr<RootWindow> root_window =
RootWindow::GetForBrowser(browser->GetIdentifier());
if (root_window) {
GtkWindow* window = GTK_WINDOW(root_window->GetWindowHandle());
if (!window)
LOG(ERROR) << "No GtkWindow for browser";
return window;
}
return NULL;
}

Are we supposed to implement something for Linux for seeing the save dialog for download and upload scenarios?

Thanks,
Harish

Re: Download and Upload support for Linux

PostPosted: Fri Jul 26, 2019 1:16 am
by Czarek
What CEF version? The download and upload dialogs are working out of the box in cefclient sample application. Looks like you've modified or removed some code and it broke it.

Re: Download and Upload support for Linux

PostPosted: Fri Jul 26, 2019 1:31 am
by hari269
We are using CEF Version: 3.3626.1895.g7001d56 compiled from sources.

Re: Download and Upload support for Linux

PostPosted: Fri Jul 26, 2019 1:37 am
by Czarek
Try with latest supported version from Spotify builds. Use build instructions from CMakeLists.txt. Do not modify code in any way and test if it works.

Re: Download and Upload support for Linux

PostPosted: Fri Jul 26, 2019 1:41 am
by hari269
This is the log message observed when clicked on the Browse from computer option on the browser

dialog_handler_gtk.cc(138)] No GtkWindow for browser
file_dialog_manager.cc(313)] No file dialog runner available for this platform

Re: Download and Upload support for Linux

PostPosted: Fri Jul 26, 2019 1:47 am
by Czarek
Please be specific and include details (OS, how you test it). Did you follow my instructions and tested with latest CEF?

Re: Download and Upload support for Linux

PostPosted: Fri Jul 26, 2019 1:53 am
by hari269
Hi Czarek,

I just checked the cef client functionality for download and upload dialog box and it works perfectly.
Thanks for the pointers.

I will check what is missing in my environment.
The error messages were shared as continuous to my last message.

Thanks,
Harish

Re: Download and Upload support for Linux

PostPosted: Sun Mar 28, 2021 11:53 am
by hari269
Hi Marshall,
Can you share info on the file dialog support in Linux for this version of the cefclient
https://bitbucket.org/chromiumembedded/ ... 57a563c375

This is pretty old, unfortunately, our application is based on it
Your response on the file dialog support in Linux for this version of dialog_handler_gtk.cc would be of great help.
In case it is supported, can you share information on any specific implementation the platform(Linux) needs to do ?

Thanks in Advance.