[Xfce4-commits] <xfce4-notifyd:master> Fix a segfault when using the summary-bold property.
Brian J. Tarricone
noreply at xfce.org
Mon Apr 12 10:56:02 CEST 2010
Updating branch refs/heads/master
to 87e2f71e95310c4b53d8acd1bc05695ecae71780 (commit)
from f23c20c4a3e80fbb7019bff1a842a64be68f242d (commit)
commit 87e2f71e95310c4b53d8acd1bc05695ecae71780
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date: Sun Dec 27 11:53:29 2009 +0100
Fix a segfault when using the summary-bold property.
When initializing an XfceNotifyWindow, gtk_widget_ensure_style was
called before initializing window->summary. As a result, in
xfce_notify_window_style_set, gtk_widget_get_style returned a wrong
value (NULL) which caused a crash in pango_font_description_copy.
Initializing window->summary at the beginning of the init function
is enough to fix this.
xfce4-notifyd/xfce-notify-window.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/xfce4-notifyd/xfce-notify-window.c b/xfce4-notifyd/xfce-notify-window.c
index d33d3b9..93fa112 100644
--- a/xfce4-notifyd/xfce-notify-window.c
+++ b/xfce4-notifyd/xfce-notify-window.c
@@ -211,6 +211,8 @@ xfce_notify_window_init(XfceNotifyWindow *window)
window->expire_timeout = DEFAULT_EXPIRE_TIMEOUT;
window->normal_opacity = DEFAULT_NORMAL_OPACITY;
window->fade_transparent = TRUE;
+ /* The summary widget needs to be initialized before style_set is called. gtk_widget_ensure_style calls style_set */
+ window->summary = gtk_label_new(NULL);
gtk_window_set_keep_above(GTK_WINDOW(window), TRUE);
gtk_window_stick(GTK_WINDOW(window));
@@ -257,7 +259,6 @@ xfce_notify_window_init(XfceNotifyWindow *window)
gtk_widget_show(vbox);
gtk_box_pack_start(GTK_BOX(tophbox), vbox, TRUE, TRUE, 0);
- window->summary = gtk_label_new(NULL);
gtk_label_set_line_wrap(GTK_LABEL(window->summary), TRUE);
gtk_misc_set_alignment(GTK_MISC(window->summary), 0.0, 0.0);
gtk_box_pack_start(GTK_BOX(vbox), window->summary, FALSE, FALSE, 0);
More information about the Xfce4-commits
mailing list