[gnome-terminal] build: Require GLib 2.50, GTK 3.22.27 and Nautilus 3.28



commit c443242be7470f3a6dca1cdd9fcbce42cf92b310
Author: Egmont Koblinger <egmont gmail com>
Date:   Sat Sep 14 22:11:52 2019 +0200

    build: Require GLib 2.50, GTK 3.22.27 and Nautilus 3.28
    
    Also move the setting of some widget properties from .c to .ui file.
    
    https://gitlab.gnome.org/GNOME/gnome-terminal/issues/104

 configure.ac                    |  6 +--
 src/preferences.ui              | 29 +++++++++++++
 src/profile-editor.c            | 96 +++--------------------------------------
 src/terminal-app.c              |  4 --
 src/terminal-nautilus.c         |  3 +-
 src/terminal-notebook.c         |  2 -
 src/terminal-options.c          |  4 --
 src/terminal-options.h          |  2 -
 src/terminal-prefs.c            | 35 ---------------
 src/terminal-screen-container.c |  4 --
 src/terminal-search-popover.c   |  6 +--
 src/terminal-tab-label.c        |  4 --
 src/terminal-window.c           | 31 -------------
 src/terminal.c                  |  2 -
 14 files changed, 40 insertions(+), 188 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index b8977d4f..6d93f611 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,7 +38,7 @@ AM_GLIB_GNU_GETTEXT
 
 AX_PTHREAD([],[AC_MSG_ERROR([pthreads are required])])
 
-GLIB_REQUIRED=2.42.0
+GLIB_REQUIRED=2.50.0
 GLIB_MIN_REQUIRED=2.42
 GLIB_MAX_ALLOWED=2.50
 
@@ -60,7 +60,7 @@ AC_MSG_RESULT([$with_gtk])
 
 case "$with_gtk" in
   3.0) GTK_API_VERSION=3.0
-       GTK_REQUIRED=3.12.0
+       GTK_REQUIRED=3.22.27
        GTK_MIN_REQUIRED=3.8
        GTK_MAX_ALLOWED=3.22
        VTE_API_VERSION=2.91
@@ -197,7 +197,7 @@ AC_ARG_WITH([nautilus-extension],
   [with_nautilus_extension=yes])
 
 if test "$with_nautilus_extension" = "yes"; then
-  NAUTILUS_REQUIRED=3.0.0
+  NAUTILUS_REQUIRED=3.28.0
 
   PKG_CHECK_MODULES([NAUTILUS],[
     libnautilus-extension >= $NAUTILUS_REQUIRED
diff --git a/src/preferences.ui b/src/preferences.ui
index f42b652c..00b6f697 100644
--- a/src/preferences.ui
+++ b/src/preferences.ui
@@ -549,6 +549,7 @@
                                     <property name="can_focus">True</property>
                                     <property name="adjustment">adjustment1</property>
                                     <property name="numeric">True</property>
+                                    <property name="input_hints">GTK_INPUT_HINT_NO_EMOJI</property>
                                   </object>
                                   <packing>
                                     <property name="expand">False</property>
@@ -585,6 +586,7 @@
                                     <property name="can_focus">True</property>
                                     <property name="adjustment">adjustment2</property>
                                     <property name="numeric">True</property>
+                                    <property name="input_hints">GTK_INPUT_HINT_NO_EMOJI</property>
                                   </object>
                                   <packing>
                                     <property name="expand">False</property>
@@ -694,6 +696,7 @@
                                     <property name="adjustment">adjustment5</property>
                                     <property name="digits">2</property>
                                     <property name="numeric">True</property>
+                                    <property name="input_hints">GTK_INPUT_HINT_NO_EMOJI</property>
                                   </object>
                                   <packing>
                                     <property name="expand">False</property>
@@ -730,6 +733,7 @@
                                     <property name="adjustment">adjustment6</property>
                                     <property name="digits">2</property>
                                     <property name="numeric">True</property>
+                                    <property name="input_hints">GTK_INPUT_HINT_NO_EMOJI</property>
                                   </object>
                                   <packing>
                                     <property name="expand">False</property>
@@ -1144,6 +1148,7 @@
                                                     <property name="receives_default">False</property>
                                                     <property name="halign">start</property>
                                                     <property name="title" translatable="yes">Choose 
Terminal Text Color</property>
+                                                    <property name="show-editor">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="top_attach">1</property>
@@ -1157,6 +1162,7 @@
                                                     <property name="receives_default">False</property>
                                                     <property name="halign">start</property>
                                                     <property name="title" translatable="yes">Choose 
Terminal Background Color</property>
+                                                    <property name="show-editor">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="top_attach">1</property>
@@ -1186,6 +1192,7 @@
                                                     <property name="receives_default">False</property>
                                                     <property name="halign">start</property>
                                                     <property name="title" translatable="yes">Choose 
Terminal Bold Text Color</property>
+                                                    <property name="show-editor">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="top_attach">2</property>
@@ -1242,6 +1249,7 @@
                                                     <property name="receives_default">True</property>
                                                     <property name="halign">start</property>
                                                     <property name="title" translatable="yes">Choose 
Terminal Cursor Foreground Color</property>
+                                                    <property name="show-editor">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="top_attach">4</property>
@@ -1255,6 +1263,7 @@
                                                     <property name="receives_default">True</property>
                                                     <property name="halign">start</property>
                                                     <property name="title" translatable="yes">Choose 
Terminal Cursor Background Color</property>
+                                                    <property name="show-editor">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="top_attach">4</property>
@@ -1283,6 +1292,7 @@
                                                     <property name="receives_default">True</property>
                                                     <property name="halign">start</property>
                                                     <property name="title" translatable="yes">Choose 
Terminal Highlight Foreground Color</property>
+                                                    <property name="show-editor">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="top_attach">5</property>
@@ -1296,6 +1306,7 @@
                                                     <property name="receives_default">True</property>
                                                     <property name="halign">start</property>
                                                     <property name="title" translatable="yes">Choose 
Terminal Highlight Background Color</property>
+                                                    <property name="show-editor">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="top_attach">5</property>
@@ -1430,6 +1441,7 @@
                                                     <property name="can_focus">True</property>
                                                     <property name="receives_default">False</property>
                                                     <property name="tooltip_text">dummy</property>
+                                                    <property name="show-editor">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="top_attach">0</property>
@@ -1442,6 +1454,7 @@
                                                     <property name="can_focus">True</property>
                                                     <property name="receives_default">False</property>
                                                     <property name="tooltip_text">dummy</property>
+                                                    <property name="show-editor">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="top_attach">0</property>
@@ -1454,6 +1467,7 @@
                                                     <property name="can_focus">True</property>
                                                     <property name="receives_default">False</property>
                                                     <property name="tooltip_text">dummy</property>
+                                                    <property name="show-editor">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="top_attach">0</property>
@@ -1466,6 +1480,7 @@
                                                     <property name="can_focus">True</property>
                                                     <property name="receives_default">False</property>
                                                     <property name="tooltip_text">dummy</property>
+                                                    <property name="show-editor">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="top_attach">0</property>
@@ -1478,6 +1493,7 @@
                                                     <property name="can_focus">True</property>
                                                     <property name="receives_default">False</property>
                                                     <property name="tooltip_text">dummy</property>
+                                                    <property name="show-editor">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="top_attach">0</property>
@@ -1490,6 +1506,7 @@
                                                     <property name="can_focus">True</property>
                                                     <property name="receives_default">False</property>
                                                     <property name="tooltip_text">dummy</property>
+                                                    <property name="show-editor">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="top_attach">0</property>
@@ -1502,6 +1519,7 @@
                                                     <property name="can_focus">True</property>
                                                     <property name="receives_default">False</property>
                                                     <property name="tooltip_text">dummy</property>
+                                                    <property name="show-editor">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="top_attach">0</property>
@@ -1514,6 +1532,7 @@
                                                     <property name="can_focus">True</property>
                                                     <property name="receives_default">False</property>
                                                     <property name="tooltip_text">dummy</property>
+                                                    <property name="show-editor">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="top_attach">0</property>
@@ -1526,6 +1545,7 @@
                                                     <property name="can_focus">True</property>
                                                     <property name="receives_default">False</property>
                                                     <property name="tooltip_text">dummy</property>
+                                                    <property name="show-editor">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="top_attach">1</property>
@@ -1538,6 +1558,7 @@
                                                     <property name="can_focus">True</property>
                                                     <property name="receives_default">False</property>
                                                     <property name="tooltip_text">dummy</property>
+                                                    <property name="show-editor">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="top_attach">1</property>
@@ -1550,6 +1571,7 @@
                                                     <property name="can_focus">True</property>
                                                     <property name="receives_default">False</property>
                                                     <property name="tooltip_text">dummy</property>
+                                                    <property name="show-editor">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="top_attach">1</property>
@@ -1562,6 +1584,7 @@
                                                     <property name="can_focus">True</property>
                                                     <property name="receives_default">False</property>
                                                     <property name="tooltip_text">dummy</property>
+                                                    <property name="show-editor">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="top_attach">1</property>
@@ -1574,6 +1597,7 @@
                                                     <property name="can_focus">True</property>
                                                     <property name="receives_default">False</property>
                                                     <property name="tooltip_text">dummy</property>
+                                                    <property name="show-editor">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="top_attach">1</property>
@@ -1586,6 +1610,7 @@
                                                     <property name="can_focus">True</property>
                                                     <property name="receives_default">False</property>
                                                     <property name="tooltip_text">dummy</property>
+                                                    <property name="show-editor">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="top_attach">1</property>
@@ -1598,6 +1623,7 @@
                                                     <property name="can_focus">True</property>
                                                     <property name="receives_default">False</property>
                                                     <property name="tooltip_text">dummy</property>
+                                                    <property name="show-editor">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="top_attach">1</property>
@@ -1610,6 +1636,7 @@
                                                     <property name="can_focus">True</property>
                                                     <property name="receives_default">False</property>
                                                     <property name="tooltip_text">dummy</property>
+                                                    <property name="show-editor">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="top_attach">1</property>
@@ -1765,6 +1792,7 @@
                                     <property name="can_focus">True</property>
                                     <property name="adjustment">adjustment4</property>
                                     <property name="numeric">True</property>
+                                    <property name="input_hints">GTK_INPUT_HINT_NO_EMOJI</property>
                                   </object>
                                   <packing>
                                     <property name="expand">False</property>
@@ -1866,6 +1894,7 @@
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="hexpand">True</property>
+                                <property name="input_hints">GTK_INPUT_HINT_NO_EMOJI</property>
                               </object>
                               <packing>
                                 <property name="top_attach">2</property>
diff --git a/src/profile-editor.c b/src/profile-editor.c
index 1912c8cf..8916c2ed 100644
--- a/src/profile-editor.c
+++ b/src/profile-editor.c
@@ -581,14 +581,6 @@ reset_compat_defaults_cb (GtkWidget *button,
  * initialize widgets
  */
 
-static void
-set_input_hints(GtkWidget *entry)
-{
-#if GTK_CHECK_VERSION (3, 22, 20)
-  gtk_entry_set_input_hints (GTK_ENTRY (entry), GTK_INPUT_HINT_NO_EMOJI);
-#endif
-}
-
 static void
 init_color_scheme_menu (GtkWidget *widget)
 {
@@ -754,47 +746,6 @@ bool_to_scrollbar_policy (const GValue *value,
   return g_variant_new_string (g_value_get_boolean (value) ? "always" : "never");
 }
 
-#if !GTK_CHECK_VERSION (3, 19, 8)
-
-/* ATTENTION: HACK HACK HACK!
- * GtkColorButton usability is broken. It always pops up the
- * GtkColorChooserDialog with show-editor=FALSE, which brings
- * up the dialogue in palette mode, when all we want is pick
- * a colour. Since there is no way to get to the colour
- * dialogue of the button, and the dialogue always sets
- * show-editor=FALSE in its map anyway, we need to override
- * the map implementation, set show-editor=TRUE and chain to
- * the parent's map. This is reasonably safe to do since that's
- * all the map functiondoes, and we can change this for _all_
- * colour chooser buttons, since they are used only in our
- * profile preferences dialogue.
- */
-
-static void
-fixup_color_chooser_dialog_map (GtkWidget *widget)
-{
-  g_object_set (GTK_COLOR_CHOOSER_DIALOG (widget), "show-editor", TRUE, NULL);
-
-  GTK_WIDGET_CLASS (g_type_class_peek_parent (GTK_COLOR_CHOOSER_DIALOG_GET_CLASS (widget)))->map (widget);
-}
-
-static void
-fixup_color_chooser_button (void)
-{
-  static gboolean done = FALSE;
-
-  if (!done) {
-    GtkColorChooserDialogClass *klass;
-    klass = g_type_class_ref (GTK_TYPE_COLOR_CHOOSER_DIALOG);
-    g_assert (klass != NULL);
-    GTK_WIDGET_CLASS (klass)->map = fixup_color_chooser_dialog_map;
-    g_type_class_unref (klass);
-    done = TRUE;
-  }
-}
-
-#endif /* GTK+ < 3.19.8 HACK */
-
 static gboolean
 monospace_filter (const PangoFontFamily *family,
                   const PangoFontFace   *face,
@@ -814,10 +765,6 @@ profile_prefs_init (void)
   the_pref_data->profile_signals = g_array_new (FALSE, FALSE, sizeof (ProfilePrefsSignal));
   the_pref_data->profile_bindings = g_array_new (FALSE, FALSE, sizeof (ProfilePrefsBinding));
 
-#if !GTK_CHECK_VERSION (3, 19, 8)
-  fixup_color_chooser_button ();
-#endif
-
   w = (GtkWidget *) gtk_builder_get_object (builder, "color-scheme-combobox");
   init_color_scheme_menu (w);
 
@@ -876,10 +823,6 @@ profile_prefs_load (const char *uuid, GSettings *profile)
       g_snprintf (name, sizeof (name), "palette-colorpicker-%u", i);
       w = (GtkWidget *) gtk_builder_get_object (builder, name);
 
-#if GTK_CHECK_VERSION (3, 19, 8)
-      g_object_set (w, "show-editor", TRUE, NULL);
-#endif
-
       g_object_set_data (G_OBJECT (w), "palette-entry-index", GUINT_TO_POINTER (i));
 
       text = g_strdup_printf (_("Choose Palette Color %u"), i);
@@ -934,13 +877,10 @@ profile_prefs_load (const char *uuid, GSettings *profile)
                                 G_CALLBACK (reset_compat_defaults_cb),
                                 profile);
 
-  w = GTK_WIDGET (gtk_builder_get_object (builder, "background-colorpicker"));
-#if GTK_CHECK_VERSION (3, 19, 8)
-  g_object_set (w, "show-editor", TRUE, NULL);
-#endif
   profile_prefs_settings_bind_with_mapping (profile,
                                             TERMINAL_PROFILE_BACKGROUND_COLOR_KEY,
-                                            w,
+                                            gtk_builder_get_object (builder,
+                                                                    "background-colorpicker"),
                                             "rgba",
                                             G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
                                             (GSettingsBindGetMapping) s_to_rgba,
@@ -969,9 +909,6 @@ profile_prefs_load (const char *uuid, GSettings *profile)
                                G_SETTINGS_BIND_SET);
 
   w = GTK_WIDGET (gtk_builder_get_object (builder, "bold-colorpicker"));
-#if GTK_CHECK_VERSION (3, 19, 8)
-  g_object_set (w, "show-editor", TRUE, NULL);
-#endif
   profile_prefs_settings_bind (profile, TERMINAL_PROFILE_BOLD_COLOR_SAME_AS_FG_KEY,
                                w,
                                "sensitive",
@@ -987,13 +924,11 @@ profile_prefs_load (const char *uuid, GSettings *profile)
                                             NULL, NULL);
 
   w = GTK_WIDGET (gtk_builder_get_object (builder, "cell-height-scale-spinbutton"));
-  set_input_hints (w);
   profile_prefs_settings_bind (profile, TERMINAL_PROFILE_CELL_HEIGHT_SCALE_KEY,
                                gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (w)),
                                "value", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
 
   w = GTK_WIDGET (gtk_builder_get_object (builder, "cell-width-scale-spinbutton"));
-  set_input_hints (w);
   profile_prefs_settings_bind (profile, TERMINAL_PROFILE_CELL_WIDTH_SCALE_KEY,
                                gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (w)),
                                "value", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
@@ -1004,9 +939,6 @@ profile_prefs_load (const char *uuid, GSettings *profile)
                                "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
 
   w = GTK_WIDGET (gtk_builder_get_object (builder, "cursor-foreground-colorpicker"));
-#if GTK_CHECK_VERSION (3, 19, 8)
-  g_object_set (w, "show-editor", TRUE, NULL);
-#endif
   profile_prefs_settings_bind (profile, TERMINAL_PROFILE_CURSOR_COLORS_SET_KEY,
                                w,
                                "sensitive",
@@ -1021,9 +953,6 @@ profile_prefs_load (const char *uuid, GSettings *profile)
                                             NULL, NULL);
 
   w = GTK_WIDGET (gtk_builder_get_object (builder, "cursor-background-colorpicker"));
-#if GTK_CHECK_VERSION (3, 19, 8)
-  g_object_set (w, "show-editor", TRUE, NULL);
-#endif
   profile_prefs_settings_bind (profile, TERMINAL_PROFILE_CURSOR_COLORS_SET_KEY,
                                w,
                                "sensitive",
@@ -1043,9 +972,6 @@ profile_prefs_load (const char *uuid, GSettings *profile)
                                "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
 
   w = GTK_WIDGET (gtk_builder_get_object (builder, "highlight-foreground-colorpicker"));
-#if GTK_CHECK_VERSION (3, 19, 8)
-  g_object_set (w, "show-editor", TRUE, NULL);
-#endif
   profile_prefs_settings_bind (profile, TERMINAL_PROFILE_HIGHLIGHT_COLORS_SET_KEY,
                                w,
                                "sensitive",
@@ -1060,9 +986,6 @@ profile_prefs_load (const char *uuid, GSettings *profile)
                                             NULL, NULL);
 
   w = GTK_WIDGET (gtk_builder_get_object (builder, "highlight-background-colorpicker"));
-#if GTK_CHECK_VERSION (3, 19, 8)
-  g_object_set (w, "show-editor", TRUE, NULL);
-#endif
   profile_prefs_settings_bind (profile, TERMINAL_PROFILE_HIGHLIGHT_COLORS_SET_KEY,
                                w,
                                "sensitive",
@@ -1101,20 +1024,17 @@ profile_prefs_load (const char *uuid, GSettings *profile)
                                             (GSettingsBindSetMapping) enum_to_string,
                                             vte_text_blink_mode_get_type, NULL);
 
-  w = GTK_WIDGET (gtk_builder_get_object (builder, "custom-command-entry"));
-  set_input_hints (w);
   profile_prefs_settings_bind (profile, TERMINAL_PROFILE_CUSTOM_COMMAND_KEY,
-                               w,
+                               gtk_builder_get_object (builder,
+                                                       "custom-command-entry"),
                                "text", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
 
   w = GTK_WIDGET (gtk_builder_get_object (builder, "default-size-columns-spinbutton"));
-  set_input_hints (w);
   profile_prefs_settings_bind (profile, TERMINAL_PROFILE_DEFAULT_SIZE_COLUMNS_KEY,
                                gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (w)),
                                "value", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
 
   w = GTK_WIDGET (gtk_builder_get_object (builder, "default-size-rows-spinbutton"));
-  set_input_hints (w);
   profile_prefs_settings_bind (profile, TERMINAL_PROFILE_DEFAULT_SIZE_ROWS_KEY,
                                gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (w)),
                                "value", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
@@ -1141,13 +1061,10 @@ profile_prefs_load (const char *uuid, GSettings *profile)
                                w,
                                "font-name", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
 
-  w = GTK_WIDGET (gtk_builder_get_object (builder, "foreground-colorpicker"));
-#if GTK_CHECK_VERSION (3, 19, 8)
-      g_object_set (w, "show-editor", TRUE, NULL);
-#endif
   profile_prefs_settings_bind_with_mapping (profile,
                                             TERMINAL_PROFILE_FOREGROUND_COLOR_KEY,
-                                            w,
+                                            gtk_builder_get_object (builder,
+                                                                    "foreground-colorpicker"),
                                             "rgba",
                                             G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
                                             (GSettingsBindGetMapping) s_to_rgba,
@@ -1160,7 +1077,6 @@ profile_prefs_load (const char *uuid, GSettings *profile)
                                "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
 
   w = GTK_WIDGET (gtk_builder_get_object (builder, "scrollback-lines-spinbutton"));
-  set_input_hints (w);
   profile_prefs_settings_bind (profile, TERMINAL_PROFILE_SCROLLBACK_LINES_KEY,
                                gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (w)),
                                "value", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
diff --git a/src/terminal-app.c b/src/terminal-app.c
index ab1c81a6..db2eb6cd 100644
--- a/src/terminal-app.c
+++ b/src/terminal-app.c
@@ -354,7 +354,6 @@ terminal_app_remove_profile (TerminalApp *app,
   terminal_settings_list_remove_child (app->profiles_list, uuid);
 }
 
-#if GTK_CHECK_VERSION (3, 19, 0)
 static void
 terminal_app_theme_variant_changed_cb (GSettings   *settings,
                                        const char  *key,
@@ -371,7 +370,6 @@ terminal_app_theme_variant_changed_cb (GSettings   *settings,
                   theme == TERMINAL_THEME_VARIANT_DARK,
                   NULL);
 }
-#endif /* GTK+ 3.19 */
 
 /* Submenus for New Terminal per profile, and to change profiles */
 
@@ -833,7 +831,6 @@ terminal_app_init (TerminalApp *app)
   app->unified_menu = g_settings_get_boolean (app->global_settings, TERMINAL_SETTING_UNIFIED_MENU_KEY);
   app->use_headerbar = terminal_app_should_use_headerbar (app);
 
-#if GTK_CHECK_VERSION (3, 19, 0)
   GtkSettings *gtk_settings = gtk_settings_get_default ();
   terminal_app_theme_variant_changed_cb (app->global_settings,
                                          TERMINAL_SETTING_THEME_VARIANT_KEY, gtk_settings);
@@ -841,7 +838,6 @@ terminal_app_init (TerminalApp *app)
                     "changed::" TERMINAL_SETTING_THEME_VARIANT_KEY,
                     G_CALLBACK (terminal_app_theme_variant_changed_cb),
                     gtk_settings);
-#endif /* GTK+ 3.19 */
 
   /* Clipboard targets */
   GdkDisplay *display = gdk_display_get_default ();
diff --git a/src/terminal-nautilus.c b/src/terminal-nautilus.c
index 36dc05c0..7c6a8431 100644
--- a/src/terminal-nautilus.c
+++ b/src/terminal-nautilus.c
@@ -24,8 +24,7 @@
 #include <gio/gio.h>
 #include <gtk/gtk.h>
 
-#include <libnautilus-extension/nautilus-menu-provider.h>
-#include <libnautilus-extension/nautilus-extension-types.h>
+#include <nautilus-extension.h>
 
 #include <errno.h>
 #include <fcntl.h>
diff --git a/src/terminal-notebook.c b/src/terminal-notebook.c
index 006922fe..9add96b8 100644
--- a/src/terminal-notebook.c
+++ b/src/terminal-notebook.c
@@ -77,9 +77,7 @@ update_tab_visibility (TerminalNotebook *notebook,
     show_tabs = new_n_pages > 1;
     break;
   case GTK_POLICY_NEVER:
-#if GTK_CHECK_VERSION (3, 16, 0)
   case GTK_POLICY_EXTERNAL:
-#endif
   default:
     show_tabs = FALSE;
     break;
diff --git a/src/terminal-options.c b/src/terminal-options.c
index 568e5c4f..964a3139 100644
--- a/src/terminal-options.c
+++ b/src/terminal-options.c
@@ -62,8 +62,6 @@ terminal_fprintf (FILE* fp,
   }
 }
 
-#if GLIB_CHECK_VERSION (2, 50, 0)
-
 /* Need to install a special log writer so we never output
  * anything without the '# ' prepended, in case --print-environment
  * is used.
@@ -82,8 +80,6 @@ terminal_log_writer (GLogLevelFlags log_level,
   return G_LOG_WRITER_HANDLED;
 }
 
-#endif /* GLIB 2.50 */
-
 static GOptionContext *get_goption_context (TerminalOptions *options);
 
 static TerminalSettingsList *
diff --git a/src/terminal-options.h b/src/terminal-options.h
index 77df9993..007a1745 100644
--- a/src/terminal-options.h
+++ b/src/terminal-options.h
@@ -182,12 +182,10 @@ void terminal_fprintf (FILE* fp,
 #define terminal_printerr(...) terminal_printerr_level(NORMAL, __VA_ARGS__)
 #define terminal_printerr_debug(...) terminal_printerr_level(DEBUG, __VA_ARGS__)
 
-#if GLIB_CHECK_VERSION (2, 50, 0)
 GLogWriterOutput terminal_log_writer (GLogLevelFlags log_level,
                                       const GLogField *fields,
                                       gsize n_fields,
                                       gpointer user_data);
-#endif
 
 G_END_DECLS
 
diff --git a/src/terminal-prefs.c b/src/terminal-prefs.c
index 07c50a12..88f7635b 100644
--- a/src/terminal-prefs.c
+++ b/src/terminal-prefs.c
@@ -269,11 +269,7 @@ popover_dialog_cancel_clicked_cb (GtkButton *button,
 {
   GtkPopover *popover_dialog = GTK_POPOVER (gtk_builder_get_object (the_pref_data->builder, 
"popover-dialog"));
 
-#if GTK_CHECK_VERSION (3, 22, 0)
   gtk_popover_popdown (popover_dialog);
-#else
-  gtk_widget_hide (GTK_WIDGET (popover_dialog));
-#endif
 }
 
 static void
@@ -359,11 +355,7 @@ profile_popup_dialog (GtkWidget *relative_to,
   gtk_popover_set_position (popover_dialog, GTK_POS_BOTTOM);
   gtk_popover_set_default_widget (popover_dialog, GTK_WIDGET (ok));
 
-#if GTK_CHECK_VERSION (3, 22, 0)
   gtk_popover_popup (popover_dialog);
-#else
-  gtk_widget_show (GTK_WIDGET (popover_dialog));
-#endif
 
   gtk_widget_grab_focus (entry_text != NULL ? GTK_WIDGET (entry) : GTK_WIDGET (cancel));
 }
@@ -442,25 +434,6 @@ profile_delete_cb (GSimpleAction *simple,
                         profile_delete_now);
 }
 
-#if !GTK_CHECK_VERSION (3, 22, 27)
-/* Avoid crash on PageUp and PageDown: bugs 791549 & 770703 */
-static gboolean
-listbox_key_press_event_cb (GtkListBox  *box,
-                            GdkEventKey *event,
-                            gpointer     user_data)
-{
-  switch (event->keyval) {
-  case GDK_KEY_Page_Up:
-  case GDK_KEY_Page_Down:
-  case GDK_KEY_KP_Page_Up:
-  case GDK_KEY_KP_Page_Down:
-    return TRUE;
-  default:
-    return FALSE;
-  }
-}
-#endif
-
 /* Create a (non-header) row of the sidebar, either a global or a profile entry. */
 static GtkListBoxRow *
 listbox_create_row (const char *name,
@@ -812,9 +785,6 @@ terminal_prefs_show_preferences (GSettings *profile, const char *widget_name)
                                 NULL);
   g_signal_connect (data->listbox, "row-selected", G_CALLBACK (listbox_row_selected_cb), data->stack);
   gtk_list_box_set_sort_func (data->listbox, listboxrow_compare_cb, NULL, NULL);
-#if !GTK_CHECK_VERSION (3, 22, 27)
-  g_signal_connect (data->listbox, "key-press-event", G_CALLBACK (listbox_key_press_event_cb), NULL);
-#endif
 
   listbox_add_all_globals (data);
   listbox_add_all_profiles (data);
@@ -843,16 +813,11 @@ terminal_prefs_show_preferences (GSettings *profile, const char *widget_name)
                      G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
   }
 
-#if GTK_CHECK_VERSION (3, 19, 0)
   g_settings_bind (settings,
                    TERMINAL_SETTING_THEME_VARIANT_KEY,
                    theme_variant_combo,
                    "active-id",
                    G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
-#else
-  gtk_widget_set_visible (theme_variant_label, FALSE);
-  gtk_widget_set_visible (theme_variant_combo, FALSE);
-#endif /* GTK+ 3.19 */
 
   if (terminal_app_get_menu_unified (app) ||
       terminal_app_get_use_headerbar (app)) {
diff --git a/src/terminal-screen-container.c b/src/terminal-screen-container.c
index 73d9b067..e2476334 100644
--- a/src/terminal-screen-container.c
+++ b/src/terminal-screen-container.c
@@ -237,12 +237,8 @@ terminal_screen_container_class_init (TerminalScreenContainerClass *klass)
 }
 #endif
 
-#if GTK_CHECK_VERSION(3, 19, 5)
-{
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
   gtk_widget_class_set_css_name(widget_class, TERMINAL_SCREEN_CONTAINER_CSS_NAME);
-}
-#endif
 
   g_object_class_install_property
     (gobject_class,
diff --git a/src/terminal-search-popover.c b/src/terminal-search-popover.c
index 8fc008f5..aa490039 100644
--- a/src/terminal-search-popover.c
+++ b/src/terminal-search-popover.c
@@ -210,7 +210,6 @@ perform_search (TerminalSearchPopover *popover,
   g_signal_emit (popover, signals[SEARCH], 0, backward);
 }
 
-#if GTK_CHECK_VERSION (3, 16, 0)
 static void
 previous_match_cb (GtkWidget *widget,
                   TerminalSearchPopover *popover)
@@ -224,7 +223,6 @@ next_match_cb (GtkWidget *widget,
 {
   perform_search (popover, FALSE);
 }
-#endif /* GTK+ 3.16 */
 
 static void
 close_clicked_cb (GtkWidget *widget,
@@ -379,7 +377,7 @@ terminal_search_popover_init (TerminalSearchPopover *popover)
     gtk_entry_set_completion (GTK_ENTRY (priv->search_entry), completion);
   }
 
-#if 0 // GTK_CHECK_VERSION (3, 17, 2)
+#if 0
   G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   gtk_popover_set_default_widget (GTK_POPOVER (popover), priv->search_prev_button);
   G_GNUC_END_IGNORE_DEPRECATIONS
@@ -388,10 +386,8 @@ terminal_search_popover_init (TerminalSearchPopover *popover)
   gtk_window_set_default (window, priv->search_prev_button);
 #endif
 
-#if GTK_CHECK_VERSION (3, 16, 0)
   g_signal_connect (priv->search_entry, "previous-match", G_CALLBACK (previous_match_cb), popover);
   g_signal_connect (priv->search_entry, "next-match", G_CALLBACK (next_match_cb), popover);
-#endif
 
   g_signal_connect (priv->search_prev_button, "clicked", G_CALLBACK (search_button_clicked_cb), popover);
   g_signal_connect (priv->search_next_button, "clicked", G_CALLBACK (search_button_clicked_cb), popover);
diff --git a/src/terminal-tab-label.c b/src/terminal-tab-label.c
index cdd73d06..2ba69150 100644
--- a/src/terminal-tab-label.c
+++ b/src/terminal-tab-label.c
@@ -196,11 +196,7 @@ terminal_tab_label_constructed (GObject *object)
   gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
   gtk_label_set_single_line_mode (GTK_LABEL (label), TRUE);
 
-#if GTK_CHECK_VERSION (3, 12, 0)
   gtk_box_set_center_widget (GTK_BOX (hbox), label);
-#else
-  gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
-#endif
 
   priv->close_button = close_button = terminal_close_button_new ();
   gtk_widget_set_tooltip_text (close_button, _("Close tab"));
diff --git a/src/terminal-window.c b/src/terminal-window.c
index 040fc4f4..911c18da 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -113,15 +113,11 @@ struct _TerminalWindowPrivate
 #endif
 
 /* See bug #789356 */
-#if GTK_CHECK_VERSION (3, 22, 23)
 #define WINDOW_STATE_TILED (GDK_WINDOW_STATE_TILED       | \
                             GDK_WINDOW_STATE_LEFT_TILED  | \
                             GDK_WINDOW_STATE_RIGHT_TILED | \
                             GDK_WINDOW_STATE_TOP_TILED   | \
                             GDK_WINDOW_STATE_BOTTOM_TILED)
-#else
-#define WINDOW_STATE_TILED (GDK_WINDOW_STATE_TILED)
-#endif
 
 static void terminal_window_dispose     (GObject             *object);
 static void terminal_window_finalize    (GObject             *object);
@@ -1371,22 +1367,10 @@ enable_menubar_accel_changed_cb (GSettings *settings,
                                  const char *key,
                                  GtkSettings *gtk_settings)
 {
-#if GTK_CHECK_VERSION (3, 20, 0)
   if (g_settings_get_boolean (settings, key))
     gtk_settings_reset_property (gtk_settings, "gtk-menu-bar-accel");
   else
     g_object_set (gtk_settings, "gtk-menu-bar-accel", NULL, NULL);
-#else
-  const char *saved_menubar_accel;
-
-  /* Now this is a bad hack on so many levels. */
-  saved_menubar_accel = g_object_get_data (G_OBJECT (gtk_settings), "GT::gtk-menu-bar-accel");
-
-  if (g_settings_get_boolean (settings, key))
-    g_object_set (gtk_settings, "gtk-menu-bar-accel", saved_menubar_accel, NULL);
-  else
-    g_object_set (gtk_settings, "gtk-menu-bar-accel", NULL, NULL);
-#endif
 }
 
 /* The menubar is shown by the app, and the use of mnemonics (e.g. Alt+F for File) is toggled.
@@ -2028,12 +2012,6 @@ terminal_window_screen_update (TerminalWindow *window,
                    "gtk-enable-accels",
                    G_SETTINGS_BIND_GET);
 
-#if !GTK_CHECK_VERSION (3, 20, 0)
-  char *value;
-  g_object_get (gtk_settings, "gtk-menu-bar-accel", &value, NULL);
-  g_object_set_data_full (G_OBJECT (gtk_settings), "GT::gtk-menu-bar-accel",
-                          value, (GDestroyNotify) g_free);
-#endif
   enable_menubar_accel_changed_cb (settings,
                                    TERMINAL_SETTING_ENABLE_MENU_BAR_ACCEL_KEY,
                                    gtk_settings);
@@ -2298,8 +2276,6 @@ terminal_window_class_init (TerminalWindowClass *klass)
   widget_class->screen_changed = terminal_window_screen_changed;
   widget_class->style_updated = terminal_window_style_updated;
 
-#if GTK_CHECK_VERSION (3, 14, 0)
-{
   GtkWindowClass *window_klass;
   GtkBindingSet *binding_set;
 
@@ -2308,19 +2284,12 @@ terminal_window_class_init (TerminalWindowClass *klass)
   gtk_binding_entry_skip (binding_set, GDK_KEY_I, GDK_CONTROL_MASK|GDK_SHIFT_MASK);
   gtk_binding_entry_skip (binding_set, GDK_KEY_D, GDK_CONTROL_MASK|GDK_SHIFT_MASK);
   g_type_class_unref (window_klass);
-}
-#endif
 
   g_type_class_add_private (object_class, sizeof (TerminalWindowPrivate));
 
   gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/terminal/ui/window.ui");
 
-#if GTK_CHECK_VERSION(3, 19, 5)
   gtk_widget_class_set_css_name(widget_class, TERMINAL_WINDOW_CSS_NAME);
-#else
-  if (gtk_check_version(3, 19, 5) == NULL)
-    g_printerr("gnome-terminal needs to be recompiled against a newer gtk+ version.\n");
-#endif
 }
 
 static void
diff --git a/src/terminal.c b/src/terminal.c
index d06ce356..601b7d22 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -550,9 +550,7 @@ main (int argc, char **argv)
 {
   int exit_code = EXIT_FAILURE;
 
-#if GLIB_CHECK_VERSION (2, 50, 0)
   g_log_set_writer_func (terminal_log_writer, NULL, NULL);
-#endif
 
   g_set_prgname ("gnome-terminal");
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]