diff options
-rw-r--r-- | applets/brightness/gpm-common.c | 4 | ||||
-rw-r--r-- | applets/inhibit/gpm-common.c | 4 | ||||
-rw-r--r-- | src/gpm-common.c | 4 | ||||
-rw-r--r-- | src/gpm-manager.c | 6 |
4 files changed, 18 insertions, 0 deletions
diff --git a/applets/brightness/gpm-common.c b/applets/brightness/gpm-common.c index e2ea5f6..da47610 100644 --- a/applets/brightness/gpm-common.c +++ b/applets/brightness/gpm-common.c @@ -45,7 +45,11 @@ gpm_help_display (const gchar *link_id) else uri = g_strdup ("help:mate-power-manager"); +#if GTK_CHECK_VERSION (3, 22, 0) + gtk_show_uri_on_window (NULL, uri, GDK_CURRENT_TIME, &error); +#else gtk_show_uri (NULL, uri, GDK_CURRENT_TIME, &error); +#endif if (error != NULL) { GtkWidget *d; diff --git a/applets/inhibit/gpm-common.c b/applets/inhibit/gpm-common.c index e2ea5f6..da47610 100644 --- a/applets/inhibit/gpm-common.c +++ b/applets/inhibit/gpm-common.c @@ -45,7 +45,11 @@ gpm_help_display (const gchar *link_id) else uri = g_strdup ("help:mate-power-manager"); +#if GTK_CHECK_VERSION (3, 22, 0) + gtk_show_uri_on_window (NULL, uri, GDK_CURRENT_TIME, &error); +#else gtk_show_uri (NULL, uri, GDK_CURRENT_TIME, &error); +#endif if (error != NULL) { GtkWidget *d; diff --git a/src/gpm-common.c b/src/gpm-common.c index c0c3c94..8b7834e 100644 --- a/src/gpm-common.c +++ b/src/gpm-common.c @@ -145,7 +145,11 @@ gpm_help_display (const gchar *link_id) else uri = g_strdup ("help:mate-power-manager"); +#if GTK_CHECK_VERSION (3, 22, 0) + gtk_show_uri_on_window (NULL, uri, GDK_CURRENT_TIME, &error); +#else gtk_show_uri (NULL, uri, GDK_CURRENT_TIME, &error); +#endif if (error != NULL) { GtkWidget *d; diff --git a/src/gpm-manager.c b/src/gpm-manager.c index 0445fd0..784532a 100644 --- a/src/gpm-manager.c +++ b/src/gpm-manager.c @@ -528,7 +528,9 @@ out: static void gpm_manager_sleep_failure_response_cb (GtkDialog *dialog, gint response_id, GpmManager *manager) { +#if !GTK_CHECK_VERSION (3, 22, 0) GdkScreen *screen; +#endif GtkWidget *dialog_error; GError *error = NULL; gboolean ret; @@ -537,8 +539,12 @@ gpm_manager_sleep_failure_response_cb (GtkDialog *dialog, gint response_id, GpmM /* user clicked the help button */ if (response_id == GTK_RESPONSE_HELP) { uri = g_settings_get_string (manager->priv->settings, GPM_SETTINGS_NOTIFY_SLEEP_FAILED_URI); +#if GTK_CHECK_VERSION (3, 22, 0) + ret = gtk_show_uri_on_window (GTK_WINDOW (dialog), uri, gtk_get_current_event_time (), &error); +#else screen = gdk_screen_get_default(); ret = gtk_show_uri (screen, uri, gtk_get_current_event_time (), &error); +#endif if (!ret) { dialog_error = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "Failed to show uri %s", error->message); |