return result;
}
+void
+gtk_file_chooser_native_set_use_portal (GtkFileChooserNative *self,
+ gboolean use_portal)
+{
+ self->use_portal = use_portal;
+}
+
static void
dialog_response_cb (GtkDialog *dialog,
int response_id,
GtkFileChooserAction action;
const char *method_name;
- if (!gdk_should_use_portal ())
+ if (!self->use_portal && !gdk_should_use_portal ())
return FALSE;
connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);
GtkWidget *accept_button;
GtkWidget *cancel_button;
+ gboolean use_portal;
gpointer mode_data;
};
+void gtk_file_chooser_native_set_use_portal (GtkFileChooserNative *self,
+ gboolean use_portal);
+
gboolean gtk_file_chooser_native_win32_show (GtkFileChooserNative *self);
void gtk_file_chooser_native_win32_hide (GtkFileChooserNative *self);
#include "gtkfiledialog.h"
#include "deprecated/gtkdialog.h"
-#include "deprecated/gtkfilechoosernative.h"
+#include "gtkfilechoosernativeprivate.h"
#include "gtkdialogerror.h"
#include <glib/gi18n-lib.h>
}
chooser = gtk_file_chooser_native_new (title, parent, action, accept, _("_Cancel"));
+ gtk_file_chooser_native_set_use_portal (chooser, TRUE);
gtk_native_dialog_set_modal (GTK_NATIVE_DIALOG (chooser), self->modal);
gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER (chooser), select_multiple);