[epiphany] Use gtk_show_uri_on_window
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Use gtk_show_uri_on_window
- Date: Sun, 19 Feb 2017 16:54:46 +0000 (UTC)
commit 486f4389a11bee5e5fb2a4e2f1b415d082e6e6b6
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Sun Feb 19 10:54:06 2017 -0600
Use gtk_show_uri_on_window
To avoid deprecation warnings
lib/ephy-gui.c | 8 +-------
src/ephy-window.c | 4 +---
src/window-commands.c | 9 +--------
3 files changed, 3 insertions(+), 18 deletions(-)
---
diff --git a/lib/ephy-gui.c b/lib/ephy-gui.c
index 8a3940b..989012f 100644
--- a/lib/ephy-gui.c
+++ b/lib/ephy-gui.c
@@ -54,7 +54,6 @@ ephy_gui_help (GtkWidget *parent,
const char *page)
{
GError *error = NULL;
- GdkScreen *screen;
char *url;
if (page)
@@ -62,12 +61,7 @@ ephy_gui_help (GtkWidget *parent,
else
url = g_strdup ("help:epiphany");
- if (parent)
- screen = gtk_widget_get_screen (parent);
- else
- screen = gdk_screen_get_default ();
-
- gtk_show_uri (screen, url, gtk_get_current_event_time (), &error);
+ gtk_show_uri_on_window (GTK_WINDOW (parent), url, gtk_get_current_event_time (), &error);
if (error != NULL) {
GtkWidget *dialog;
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 822776c..95e3922 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1946,10 +1946,8 @@ decide_policy_cb (WebKitWebView *web_view,
if (!ephy_embed_utils_address_has_web_scheme (uri)) {
GError *error = NULL;
- GdkScreen *screen;
- screen = gtk_widget_get_screen (GTK_WIDGET (web_view));
- gtk_show_uri (screen, uri, GDK_CURRENT_TIME, &error);
+ gtk_show_uri_on_window (GTK_WINDOW (window), uri, GDK_CURRENT_TIME, &error);
if (error) {
LOG ("failed to handle non web scheme: %s", error->message);
diff --git a/src/window-commands.c b/src/window-commands.c
index 04b27f5..4eccd96 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -2052,7 +2052,6 @@ window_cmd_send_to (GSimpleAction *action,
EphyEmbed *embed;
char *command, *subject, *body;
const char *location, *title;
- GdkScreen *screen;
GError *error = NULL;
embed = ephy_embed_container_get_active_child
@@ -2072,13 +2071,7 @@ window_cmd_send_to (GSimpleAction *action,
g_free (subject);
g_free (body);
- if (window) {
- screen = gtk_widget_get_screen (GTK_WIDGET (window));
- } else {
- screen = gdk_screen_get_default ();
- }
-
- if (!gtk_show_uri (screen, command, gtk_get_current_event_time (), &error)) {
+ if (!gtk_show_uri_on_window (GTK_WINDOW (window), command, gtk_get_current_event_time (), &error)) {
g_warning ("Unable to send link by email: %s\n", error->message);
g_error_free (error);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]