[gtk/wip/baedert/for-master: 171/180] filechooserwidget: gtk_widget_get_root() can return NULL
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master: 171/180] filechooserwidget: gtk_widget_get_root() can return NULL
- Date: Fri, 16 Oct 2020 19:58:53 +0000 (UTC)
commit b76ec78a39d3195d3265bc1d0b64bbc8b5d5f43c
Author: Timm Bäder <mail baedert org>
Date: Thu Oct 15 06:56:58 2020 +0200
filechooserwidget: gtk_widget_get_root() can return NULL
gtk/gtkfilechooserwidget.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index 50b9f6033e..171301a24b 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -619,11 +619,11 @@ gtk_file_chooser_widget_finalize (GObject *object)
static GtkWindow *
get_toplevel (GtkWidget *widget)
{
- GtkWidget *toplevel;
+ GtkRoot *root;
- toplevel = GTK_WIDGET (gtk_widget_get_root (widget));
- if (GTK_IS_WINDOW (toplevel))
- return GTK_WINDOW (toplevel);
+ root = gtk_widget_get_root (widget);
+ if (root && GTK_IS_WINDOW (root))
+ return GTK_WINDOW (root);
else
return NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]