[gnome-builder] change deprecated gtk_show_uri
- From: Sébastien Lafargue <slafargue src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] change deprecated gtk_show_uri
- Date: Mon, 27 Feb 2017 18:32:52 +0000 (UTC)
commit e92be394df67af7f505b8e7f6c3ddaa168274087
Author: Sebastien Lafargue <slafargue gnome org>
Date: Mon Feb 27 19:25:30 2017 +0100
change deprecated gtk_show_uri
This function is replaced by gtk_show_uri_on_window
libide/application/ide-application-actions.c | 10 +++-----
plugins/terminal/gb-terminal.c | 32 +++++++++++++++++++++-----
2 files changed, 30 insertions(+), 12 deletions(-)
---
diff --git a/libide/application/ide-application-actions.c b/libide/application/ide-application-actions.c
index d05f80b..e3100b9 100644
--- a/libide/application/ide-application-actions.c
+++ b/libide/application/ide-application-actions.c
@@ -145,18 +145,16 @@ ide_application_actions_help (GSimpleAction *action,
{
IdeApplication *self = user_data;
GtkWindow *focused_window= NULL;
- GdkScreen *screen = NULL;
GError *err = NULL;
g_assert (IDE_IS_APPLICATION (self));
focused_window = gtk_application_get_active_window (GTK_APPLICATION (self));
- screen = gtk_window_get_screen (focused_window);
- gtk_show_uri (screen,
- "help:gnome-builder",
- gtk_get_current_event_time (),
- &err);
+ gtk_show_uri_on_window (focused_window,
+ "help:gnome-builder",
+ gtk_get_current_event_time (),
+ &err);
if (err)
{
g_message ("Unable to open help: %s\n", err->message);
diff --git a/plugins/terminal/gb-terminal.c b/plugins/terminal/gb-terminal.c
index c3887b6..029fbdd 100644
--- a/plugins/terminal/gb-terminal.c
+++ b/plugins/terminal/gb-terminal.c
@@ -182,8 +182,19 @@ gb_terminal_button_press_event (GtkWidget *widget,
pattern = vte_terminal_match_check_event (VTE_TERMINAL (self), (GdkEvent *)button, NULL);
if (pattern != NULL)
- gtk_show_uri (gtk_widget_get_screen (widget), pattern,
- gtk_get_current_event_time (), NULL);
+ {
+ GtkApplication *app;
+ GtkWindow *focused_window;
+
+ if (NULL != (app = GTK_APPLICATION (g_application_get_default ())) &&
+ NULL != (focused_window = gtk_application_get_active_window (app)))
+ {
+ gtk_show_uri_on_window (focused_window,
+ pattern,
+ gtk_get_current_event_time (),
+ NULL);
+ }
+ }
return GDK_EVENT_STOP;
}
@@ -222,16 +233,25 @@ gb_terminal_copy_link_address (GbTerminal *self)
static gboolean
gb_terminal_open_link (GbTerminal *self)
{
+ GtkApplication *app;
+ GtkWindow *focused_window;
+
g_assert (GB_IS_TERMINAL (self));
g_assert (self->url != NULL);
if (ide_str_empty0 (self->url))
return FALSE;
- return gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (self)),
- self->url,
- gtk_get_current_event_time (),
- NULL);
+ if (NULL != (app = GTK_APPLICATION (g_application_get_default ())) &&
+ NULL != (focused_window = gtk_application_get_active_window (app)))
+ {
+ return gtk_show_uri_on_window (focused_window,
+ self->url,
+ gtk_get_current_event_time (),
+ NULL);
+ }
+ else
+ return FALSE;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]