diff options
Diffstat (limited to 'libempathy-gtk/gossip-ui-utils.c')
-rw-r--r-- | libempathy-gtk/gossip-ui-utils.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libempathy-gtk/gossip-ui-utils.c b/libempathy-gtk/gossip-ui-utils.c index f9628f014..f834ceb0c 100644 --- a/libempathy-gtk/gossip-ui-utils.c +++ b/libempathy-gtk/gossip-ui-utils.c @@ -1254,6 +1254,21 @@ gossip_window_present (GtkWindow *window, } } +GtkWindow * +gossip_get_toplevel_window (GtkWidget *widget) +{ + GtkWidget *toplevel; + + g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); + + toplevel = gtk_widget_get_toplevel (widget); + if (GTK_IS_WINDOW (toplevel)) { + return GTK_WINDOW (toplevel); + } + + return NULL; +} + /* The URL opening code can't handle schemeless strings, so we try to be * smart and add http if there is no scheme or doesn't look like a mail * address. This should work in most cases, and let us click on strings |