[hitori] interface: Don’t require new GTK+ API



commit ce1636be85c224a0cce5ebd7c02c943dcdee725a
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sun Apr 30 23:17:56 2017 +0100

    interface: Don’t require new GTK+ API
    
    If we’re compiling against GTK+ older than 3.22.0, use the old
    gtk_show_uri() API rather than the new one.
    
    This is a follow up to commit 3b835d2.
    
    Signed-off-by: Philip Withnall <philip tecnocode co uk>

 src/interface.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/interface.c b/src/interface.c
index 8a5e46f..d322683 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -633,8 +633,15 @@ help_cb (GSimpleAction *action, GVariant *parameters, gpointer user_data)
 {
        HitoriApplication *self = HITORI_APPLICATION (user_data);
        GError *error = NULL;
+       gboolean retval;
 
-       if (gtk_show_uri_on_window (GTK_WINDOW (self->window), "help:hitori", gtk_get_current_event_time (), 
&error) == FALSE) {
+#if GTK_CHECK_VERSION(3, 22, 0)
+       retval = gtk_show_uri_on_window (GTK_WINDOW (self->window), "help:hitori", gtk_get_current_event_time 
(), &error);
+#else
+       retval = gtk_show_uri (gtk_widget_get_screen (self->window), "help:hitori", 
gtk_get_current_event_time (), &error);
+#endif
+
+       if (retval == FALSE) {
                GtkWidget *dialog = gtk_message_dialog_new (GTK_WINDOW (self->window),
                                                            GTK_DIALOG_MODAL,
                                                            GTK_MESSAGE_ERROR,


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