[gtk+] Fix possible crash in header bar
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Fix possible crash in header bar
- Date: Fri, 27 Sep 2013 15:28:10 +0000 (UTC)
commit f5291660e0131499e1c884170c21a8f60d8f0255
Author: Bastien Nocera <hadess hadess net>
Date: Fri Sep 27 17:06:01 2013 +0200
Fix possible crash in header bar
When the header bar's top-level widget is not a GtkWindow,
don't try to get the inexistant "decoration-button-layout"
property.
gtk/gtkheaderbar.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkheaderbar.c b/gtk/gtkheaderbar.c
index 4a0481a..412b27c 100644
--- a/gtk/gtkheaderbar.c
+++ b/gtk/gtkheaderbar.c
@@ -650,12 +650,15 @@ gtk_header_bar_get_preferred_height_for_width (GtkWidget *widget,
static gboolean
close_button_at_end (GtkWidget *widget)
{
+ GtkWidget *toplevel;
gchar *layout_desc;
gboolean at_end;
gchar *p;
- gtk_widget_style_get (gtk_widget_get_toplevel (widget),
- "decoration-button-layout", &layout_desc, NULL);
+ toplevel = gtk_widget_get_toplevel (widget);
+ if (!GTK_IS_WINDOW (toplevel))
+ return TRUE;
+ gtk_widget_style_get (toplevel, "decoration-button-layout", &layout_desc, NULL);
p = strchr (layout_desc, ':');
if (p && strstr (p, "close"))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]