diff --git a/plugins/saveactions.c b/plugins/saveactions.c index 1425722988..c004611716 100644 --- a/plugins/saveactions.c +++ b/plugins/saveactions.c @@ -447,19 +447,19 @@ void plugin_init(GeanyData *data) static gint file_chooser_run(GtkFileChooser *dialog) { - if (GTK_IS_WIDGET(dialog)) + if (GTK_IS_NATIVE_DIALOG(dialog)) + return gtk_native_dialog_run(GTK_NATIVE_DIALOG(dialog)); + else return gtk_dialog_run(GTK_DIALOG(dialog)); - - return gtk_native_dialog_run(GTK_NATIVE_DIALOG(dialog)); } static void file_chooser_destroy(GtkFileChooser *dialog) { - if (GTK_IS_WIDGET(dialog)) - gtk_widget_destroy(GTK_WIDGET(dialog)); - else + if (GTK_IS_NATIVE_DIALOG(dialog)) g_object_unref(dialog); + else + gtk_widget_destroy(GTK_WIDGET(dialog)); } diff --git a/src/dialogs.c b/src/dialogs.c index bde8750ff2..2919f325bf 100644 --- a/src/dialogs.c +++ b/src/dialogs.c @@ -133,7 +133,7 @@ static gboolean open_file_dialog_handle_response(GtkFileChooser *dialog, gint re const gchar *charset = NULL; gboolean ro = (response == GEANY_RESPONSE_VIEW); /* View clicked */ - if (GTK_IS_WIDGET(dialog)) + if (!GTK_IS_NATIVE_DIALOG(dialog)) { GtkWidget *expander = ui_lookup_widget(GTK_WIDGET(dialog), "more_options_expander"); GtkWidget *filetype_combo = ui_lookup_widget(GTK_WIDGET(dialog), "filetype_combo"); @@ -457,19 +457,19 @@ static void open_file_dialog_apply_settings(GtkWidget *dialog) gint dialogs_file_chooser_run(GtkFileChooser *dialog) { - if (GTK_IS_WIDGET(dialog)) + if (GTK_IS_NATIVE_DIALOG(dialog)) + return gtk_native_dialog_run(GTK_NATIVE_DIALOG(dialog)); + else return gtk_dialog_run(GTK_DIALOG(dialog)); - - return gtk_native_dialog_run(GTK_NATIVE_DIALOG(dialog)); } void dialogs_file_chooser_destroy(GtkFileChooser *dialog) { - if (GTK_IS_WIDGET(dialog)) - gtk_widget_destroy(GTK_WIDGET(dialog)); - else + if (GTK_IS_NATIVE_DIALOG(dialog)) g_object_unref(dialog); + else + gtk_widget_destroy(GTK_WIDGET(dialog)); } @@ -490,7 +490,7 @@ void dialogs_show_open_file(void) SETPTR(initdir, utils_get_locale_from_utf8(initdir)); dialog = create_open_file_dialog(); - if (GTK_IS_WIDGET(dialog)) + if (!GTK_IS_NATIVE_DIALOG(dialog)) open_file_dialog_apply_settings(GTK_WIDGET(dialog)); if (initdir != NULL && g_path_is_absolute(initdir))