From 9ca7b21abd4a4d4d65f3edcdb2476aca067773c1 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Mon, 28 Sep 2015 20:54:34 +0200 Subject: vteapp: Fix build with gtk+ < 3.16 https://bugzilla.gnome.org/show_bug.cgi?id=755650 --- configure.ac | 7 +++++++ src/Makefile.am | 4 ++++ src/app.vala | 2 ++ 3 files changed, 13 insertions(+) diff --git a/configure.ac b/configure.ac index 213060a2..ee34914b 100644 --- a/configure.ac +++ b/configure.ac @@ -329,7 +329,14 @@ AM_PROG_VALAC([0.18.0],[],[ AC_MSG_ERROR([vala support enabled by vala compiler not found]) fi]) +if test "$enable_test_application" = "yes"; then + PKG_CHECK_MODULES([GTK_3_16],[gtk+-3.0 >= 3.16],[have_gtk_3_16=yes],[have_gtk_3_16=no]) +else + have_gtk_3_16=no +fi + AM_CONDITIONAL([ENABLE_TEST_APPLICATION],[test "$enable_test_application" = "yes"]) +AM_CONDITIONAL([HAVE_GTK_3_16],[test "$have_gtk_3_16" = "yes"]) # *************** # Auxiliary tools diff --git a/src/Makefile.am b/src/Makefile.am index 27909df6..4bbff1ec 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -302,6 +302,10 @@ vte_@VTE_API_MAJOR_VERSION@_@VTE_API_MINOR_VERSION@_LDADD = \ $(VTE_LIBS) \ $(NULL) +if HAVE_GTK_3_16 +vte_@VTE_API_MAJOR_VERSION@_@VTE_API_MINOR_VERSION@_VALAFLAGS += -D GTK_3_16 +endif + CLEANFILES += \ app.c \ appresources.c \ diff --git a/src/app.vala b/src/app.vala index 25279609..e6ee9342 100644 --- a/src/app.vala +++ b/src/app.vala @@ -46,8 +46,10 @@ class SearchPopover : Gtk.Popover close_button.clicked.connect(() => { hide(); }); reveal_button.bind_property("active", revealer, "reveal-child"); +#if GTK_3_16 search_entry.next_match.connect(() => { search(false); }); search_entry.previous_match.connect(() => { search(true); }); +#endif search_entry.search_changed.connect(() => { update_regex(); }); search_next_button.clicked.connect(() => { search(false); }); -- cgit v1.2.1