Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Sat, 08 Jun 2024 19:37:28 UTC Commit: 4b1be9a5776d1ca125a2b70177b618acee9b9db5 https://github.com/geany/geany/commit/4b1be9a5776d1ca125a2b70177b618acee9b9d...
Log Message: ----------- Use GTK_IS_NATIVE_DIALOG() in tests instead of GTK_IS_WIDGET()
Modified Paths: -------------- plugins/saveactions.c src/dialogs.c
Modified: plugins/saveactions.c 12 lines changed, 6 insertions(+), 6 deletions(-) =================================================================== @@ -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)); }
Modified: src/dialogs.c 16 lines changed, 8 insertions(+), 8 deletions(-) =================================================================== @@ -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))
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).