filechoosernative: Drop the use_portal override

We are going to prefer portals when available anyway,
going forward, so there shouldn't be a need for this
anymore.
This commit is contained in:
Matthias Clasen 2024-11-18 16:23:31 -05:00
parent a03109a7b9
commit 2ed95e542a
4 changed files with 1 additions and 23 deletions

View File

@ -561,13 +561,6 @@ gtk_file_chooser_native_new (const char *title,
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,

View File

@ -478,7 +478,7 @@ gtk_file_chooser_native_portal_show (GtkFileChooserNative *self,
GtkFileChooserAction action;
const char *method_name;
if (!self->use_portal && !gdk_should_use_portal ())
if (!gdk_should_use_portal ())
return FALSE;
connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);

View File

@ -51,13 +51,9 @@ struct _GtkFileChooserNative
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);

View File

@ -804,7 +804,6 @@ create_file_chooser (GtkFileDialog *self,
GtkFileChooserNative *chooser;
const char *default_accept_label, *accept;
const char *default_title, *title;
GdkDisplay *display G_GNUC_UNUSED;
switch (action)
{
@ -839,16 +838,6 @@ create_file_chooser (GtkFileDialog *self,
chooser = gtk_file_chooser_native_new (title, parent, action, accept, _("_Cancel"));
if (parent)
display = gtk_widget_get_display (GTK_WIDGET (parent));
else
display = gdk_display_get_default ();
if (GDK_DISPLAY_DEBUG_CHECK (display, NO_PORTALS))
gtk_file_chooser_native_set_use_portal (chooser, FALSE);
else
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);