You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-21 14:57:09 +00:00
Merge pull request #80104 from bruvzg/freedesktop_native_file_dialog
[Linux/Freedesktop] Implement native file selection dialog support.
This commit is contained in:
@@ -122,6 +122,9 @@ bool DisplayServerX11::has_feature(Feature p_feature) const {
|
||||
case FEATURE_WINDOW_TRANSPARENCY:
|
||||
//case FEATURE_HIDPI:
|
||||
case FEATURE_ICON:
|
||||
#ifdef DBUS_ENABLED
|
||||
case FEATURE_NATIVE_DIALOG:
|
||||
#endif
|
||||
//case FEATURE_NATIVE_ICON:
|
||||
case FEATURE_SWAP_BUFFERS:
|
||||
#ifdef DBUS_ENABLED
|
||||
@@ -360,6 +363,17 @@ bool DisplayServerX11::is_dark_mode() const {
|
||||
}
|
||||
}
|
||||
|
||||
Error DisplayServerX11::file_dialog_show(const String &p_title, const String &p_current_directory, const String &p_filename, bool p_show_hidden, FileDialogMode p_mode, const Vector<String> &p_filters, const Callable &p_callback) {
|
||||
WindowID window_id = _get_focused_window_or_popup();
|
||||
|
||||
if (!windows.has(window_id)) {
|
||||
window_id = MAIN_WINDOW_ID;
|
||||
}
|
||||
|
||||
String xid = vformat("x11:%x", (uint64_t)windows[window_id].x11_window);
|
||||
return portal_desktop->file_dialog_show(xid, p_title, p_current_directory, p_filename, p_mode, p_filters, p_callback);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void DisplayServerX11::mouse_set_mode(MouseMode p_mode) {
|
||||
|
||||
Reference in New Issue
Block a user