Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Sat, 07 Oct 2023 17:54:40 UTC Commit: 31dfef5e12bc5adfe9ca7ed3baf6192dab24b2eb https://github.com/geany/geany/commit/31dfef5e12bc5adfe9ca7ed3baf6192dab24b2...
Log Message: ----------- Bump GTK version requirement to 3.24
Modified Paths: -------------- HACKING m4/geany-gtk.m4 meson.build plugins/splitwindow.c src/dialogs.c src/editor.c src/vte.c
Modified: HACKING 5 lines changed, 1 insertions(+), 4 deletions(-) =================================================================== @@ -204,10 +204,7 @@ Coding them down into smaller static functions where possible. This makes code much easier to read and maintain. * Use GLib types and functions - gint not int, g_free() not free(). -* Your code should build against GLib 2.32 and GTK 3.0. At least for the - moment, we want to keep the minimum requirement for GTK at 3.0 (of - course, you can use the GTK_CHECK_VERSION macro to protect code using - later versions). +* Your code should build against GLib 2.32 and GTK 3.24. * Variables should be declared (and initialized) as close as practical to their first use. This reduces the chances of intervening code being inserted between declaration and use, where the variable may be
Modified: m4/geany-gtk.m4 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -2,7 +2,7 @@ dnl GEANY_CHECK_GTK dnl Checks whether the GTK stack is available and new enough. Sets GTK_CFLAGS and GTK_LIBS. AC_DEFUN([GEANY_CHECK_GTK], [ - gtk_modules="gtk+-3.0 >= 3.0 glib-2.0 >= 2.32" + gtk_modules="gtk+-3.0 >= 3.24 glib-2.0 >= 2.32" gtk_modules_private="gio-2.0 >= 2.32 gmodule-no-export-2.0 gthread-2.0"
PKG_CHECK_MODULES([GTK], [$gtk_modules $gtk_modules_private])
Modified: meson.build 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -13,7 +13,7 @@ prefix = get_option('prefix') deps_in = [ ['glib-2.0', '2.32'], ['gmodule-2.0', '2.32'], - ['gtk+-3.0', '3.0'] + ['gtk+-3.0', '3.24'] ]
deps = []
Modified: plugins/splitwindow.c 29 lines changed, 0 insertions(+), 29 deletions(-) =================================================================== @@ -256,32 +256,6 @@ static void on_doc_show_menu(GtkMenuToolButton *button, GtkMenu *menu) }
-/* Blocks the ::show-menu signal if the menu's parent toggle button was inactive in the previous run. - * This is a hack to workaround https://bugzilla.gnome.org/show_bug.cgi?id=769287 - * and should NOT be used for any other version than 3.15.9 to 3.21.4, although the code tries and - * not block a legitimate signal in case the GTK version in use has been patched */ -static void show_menu_gtk316_fix(GtkMenuToolButton *button, gpointer data) -{ - /* we assume only a single menu can popup at once, so reentrency isn't an issue. - * if it was, we could use custom data on the button, but it shouldn't be required */ - static gboolean block_next = FALSE; - - if (block_next) - { - g_signal_stop_emission_by_name(button, "show-menu"); - block_next = FALSE; - } - else - { - GtkWidget *menu = gtk_menu_tool_button_get_menu(button); - GtkWidget *parent = gtk_menu_get_attach_widget(GTK_MENU(menu)); - - if (parent && GTK_IS_TOGGLE_BUTTON(parent) && ! gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(parent))) - block_next = TRUE; - } -} - - static GtkWidget *create_toolbar(void) { GtkWidget *toolbar, *item; @@ -300,9 +274,6 @@ static GtkWidget *create_toolbar(void)
item = gtk_menu_new(); gtk_menu_tool_button_set_menu(GTK_MENU_TOOL_BUTTON(tool_item), item); - /* hack for https://bugzilla.gnome.org/show_bug.cgi?id=769287 */ - if (! gtk_check_version(3, 15, 9) && gtk_check_version(3, 21, 4+1)) - g_signal_connect(tool_item, "show-menu", G_CALLBACK(show_menu_gtk316_fix), NULL); g_signal_connect(tool_item, "show-menu", G_CALLBACK(on_doc_show_menu), item);
tool_item = gtk_tool_item_new();
Modified: src/dialogs.c 24 lines changed, 5 insertions(+), 19 deletions(-) =================================================================== @@ -815,20 +815,6 @@ gboolean dialogs_show_unsaved_file(GeanyDocument *doc) }
-/* Use GtkFontChooserDialog on GTK3.2 for consistency, and because - * GtkFontSelectionDialog is somewhat broken on 3.4 */ -#if GTK_CHECK_VERSION(3, 2, 0) -# undef GTK_FONT_SELECTION_DIALOG -# define GTK_FONT_SELECTION_DIALOG GTK_FONT_CHOOSER_DIALOG - -# define gtk_font_selection_dialog_new(title) \ - gtk_font_chooser_dialog_new((title), NULL) -# define gtk_font_selection_dialog_get_font_name(dlg) \ - gtk_font_chooser_get_font(GTK_FONT_CHOOSER(dlg)) -# define gtk_font_selection_dialog_set_font_name(dlg, font) \ - gtk_font_chooser_set_font(GTK_FONT_CHOOSER(dlg), (font)) -#endif - static void on_font_dialog_response(GtkDialog *dialog, gint response, gpointer user_data) { @@ -841,8 +827,8 @@ on_font_dialog_response(GtkDialog *dialog, gint response, gpointer user_data) { gchar *fontname;
- fontname = gtk_font_selection_dialog_get_font_name( - GTK_FONT_SELECTION_DIALOG(ui_widgets.open_fontsel)); + fontname = gtk_font_chooser_get_font( + GTK_FONT_CHOOSER(ui_widgets.open_fontsel)); ui_set_editor_font(fontname); g_free(fontname);
@@ -863,7 +849,7 @@ void dialogs_show_open_font(void) { GtkWidget *apply_button;
- ui_widgets.open_fontsel = gtk_font_selection_dialog_new(_("Choose font"));; + ui_widgets.open_fontsel = gtk_font_chooser_dialog_new(_("Choose font"), NULL); gtk_container_set_border_width(GTK_CONTAINER(ui_widgets.open_fontsel), 4); gtk_window_set_modal(GTK_WINDOW(ui_widgets.open_fontsel), TRUE); gtk_window_set_destroy_with_parent(GTK_WINDOW(ui_widgets.open_fontsel), TRUE); @@ -883,8 +869,8 @@ void dialogs_show_open_font(void)
gtk_window_set_transient_for(GTK_WINDOW(ui_widgets.open_fontsel), GTK_WINDOW(main_widgets.window)); } - gtk_font_selection_dialog_set_font_name( - GTK_FONT_SELECTION_DIALOG(ui_widgets.open_fontsel), interface_prefs.editor_font); + gtk_font_chooser_set_font( + GTK_FONT_CHOOSER(ui_widgets.open_fontsel), interface_prefs.editor_font); /* We make sure the dialog is visible. */ gtk_window_present(GTK_WINDOW(ui_widgets.open_fontsel)); }
Modified: src/editor.c 8 lines changed, 0 insertions(+), 8 deletions(-) =================================================================== @@ -4960,14 +4960,6 @@ static ScintillaObject *create_new_sci(GeanyEditor *editor) /* input method editor's candidate window behaviour */ SSM(sci, SCI_SETIMEINTERACTION, editor_prefs.ime_interaction, 0);
-#ifdef GDK_WINDOWING_QUARTZ -# if ! GTK_CHECK_VERSION(3,16,0) - /* "retina" (HiDPI) display support on OS X - requires disabling buffered draw - * on older GTK versions */ - SSM(sci, SCI_SETBUFFEREDDRAW, 0, 0); -# endif -#endif - /* only connect signals if this is for the document notebook, not split window */ if (editor->sci == NULL) {
Modified: src/vte.c 26 lines changed, 1 insertions(+), 25 deletions(-) =================================================================== @@ -718,7 +718,6 @@ static GtkWidget *vte_create_popup_menu(void) { GtkWidget *menu, *item; GtkAccelGroup *accel_group; - gboolean show_im_menu = TRUE;
menu = gtk_menu_new();
@@ -773,30 +772,7 @@ static GtkWidget *vte_create_popup_menu(void)
msgwin_menu_add_common_items(GTK_MENU(menu));
- /* VTE 2.91 doesn't have IM context items, and GTK >= 3.10 doesn't show them anyway */ - if (! vf->vte_terminal_im_append_menuitems || gtk_check_version(3, 10, 0) == NULL) - show_im_menu = FALSE; - else /* otherwise, query the setting */ - g_object_get(gtk_settings_get_default(), "gtk-show-input-method-menu", &show_im_menu, NULL); - - if (! show_im_menu) - vte_config.im_submenu = NULL; - else - { - item = gtk_separator_menu_item_new(); - gtk_widget_show(item); - gtk_container_add(GTK_CONTAINER(menu), item); - - /* the IM submenu should always be the last item to be consistent with other GTK popup menus */ - vte_config.im_submenu = gtk_menu_new(); - - item = gtk_image_menu_item_new_with_mnemonic(_("_Input Methods")); - gtk_widget_show(item); - gtk_container_add(GTK_CONTAINER(menu), item); - - gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), vte_config.im_submenu); - /* submenu populated after vte realized */ - } + vte_config.im_submenu = NULL;
return menu; }
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).