summaryrefslogtreecommitdiff
path: root/mateweather
diff options
context:
space:
mode:
Diffstat (limited to 'mateweather')
-rw-r--r--mateweather/mateweather-applet.c13
-rw-r--r--mateweather/mateweather-dialog.c13
-rw-r--r--mateweather/mateweather-pref.c7
3 files changed, 27 insertions, 6 deletions
diff --git a/mateweather/mateweather-applet.c b/mateweather/mateweather-applet.c
index 9870547e..245e812c 100644
--- a/mateweather/mateweather-applet.c
+++ b/mateweather/mateweather-applet.c
@@ -53,10 +53,17 @@ static void help_cb (GtkAction *action,
{
GError *error = NULL;
+#if GTK_CHECK_VERSION (3, 22, 0)
+ gtk_show_uri_on_window (NULL,
+ "help:mateweather",
+ gtk_get_current_event_time (),
+ &error);
+#else
gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (gw_applet->applet)),
- "help:mateweather",
- gtk_get_current_event_time (),
- &error);
+ "help:mateweather",
+ gtk_get_current_event_time (),
+ &error);
+#endif
if (error) {
GtkWidget *dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
diff --git a/mateweather/mateweather-dialog.c b/mateweather/mateweather-dialog.c
index dc14080d..5f7911dc 100644
--- a/mateweather/mateweather-dialog.c
+++ b/mateweather/mateweather-dialog.c
@@ -109,10 +109,17 @@ static void response_cb(MateWeatherDialog* dialog, gint id, gpointer data)
static void link_cb(GtkButton* button, gpointer data)
{
+#if GTK_CHECK_VERSION (3, 22, 0)
+ gtk_show_uri_on_window (NULL,
+ "http://www.weather.com/",
+ gtk_get_current_event_time (),
+ NULL);
+#else
gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (button)),
- "http://www.weather.com/",
- gtk_get_current_event_time (),
- NULL);
+ "http://www.weather.com/",
+ gtk_get_current_event_time (),
+ NULL);
+#endif
}
static gchar* replace_multiple_new_lines(gchar* s)
diff --git a/mateweather/mateweather-pref.c b/mateweather/mateweather-pref.c
index 266a615a..faee9e0b 100644
--- a/mateweather/mateweather-pref.c
+++ b/mateweather/mateweather-pref.c
@@ -744,7 +744,14 @@ static void help_cb(GtkDialog* dialog, MateWeatherPref* pref)
current_page = gtk_notebook_get_current_page (GTK_NOTEBOOK (pref->priv->notebook));
uri = g_strdup_printf ("help:mateweather/mateweather-prefs#mateweather-%s", (current_page == 0) ? "metric" : "change-location");
+#if GTK_CHECK_VERSION (3, 22, 0)
+ gtk_show_uri_on_window (GTK_WINDOW (dialog),
+ uri,
+ gtk_get_current_event_time (),
+ &error);
+#else
gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (dialog)), uri, gtk_get_current_event_time (), &error);
+#endif
g_free (uri);
if (error)