[notification-daemon] Connect to the style set signal instead of implementing it
- From: William Jon McCann <mccann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [notification-daemon] Connect to the style set signal instead of implementing it
- Date: Thu, 7 Oct 2010 21:35:12 +0000 (UTC)
commit 354da48bb36c2c3189d867b1b4fb42f858286825
Author: William Jon McCann <jmccann redhat com>
Date: Thu Oct 7 17:34:14 2010 -0400
Connect to the style set signal instead of implementing it
This way we can block recursive emission.
src/nd-bubble.c | 19 +++++--------------
1 files changed, 5 insertions(+), 14 deletions(-)
---
diff --git a/src/nd-bubble.c b/src/nd-bubble.c
index 9c7656e..9aea4cf 100644
--- a/src/nd-bubble.c
+++ b/src/nd-bubble.c
@@ -137,9 +137,6 @@ override_style (GtkWidget *widget,
GdkColor fg;
GdkColor bg;
- /* FIXME! causes a segfault */
- return;
-
gtk_widget_ensure_style (widget);
old_style = gtk_widget_get_style (widget);
style = gtk_style_copy (old_style);
@@ -176,16 +173,6 @@ override_style (GtkWidget *widget,
}
static void
-nd_bubble_style_set (GtkWidget *widget,
- GtkStyle *previous_style)
-{
- override_style (widget, previous_style);
- gtk_widget_queue_draw (widget);
-
- GTK_WIDGET_CLASS (nd_bubble_parent_class)->style_set (widget, previous_style);
-}
-
-static void
nd_bubble_composited_changed (GtkWidget *widget)
{
NdBubble *bubble = ND_BUBBLE (widget);
@@ -433,7 +420,6 @@ nd_bubble_class_init (NdBubbleClass *klass)
object_class->finalize = nd_bubble_finalize;
- widget_class->style_set = nd_bubble_style_set;
widget_class->draw = nd_bubble_draw;
widget_class->configure_event = nd_bubble_configure_event;
widget_class->composited_changed = nd_bubble_composited_changed;
@@ -514,6 +500,11 @@ nd_bubble_init (NdBubble *bubble)
bubble->priv = ND_BUBBLE_GET_PRIVATE (bubble);
+ g_signal_connect (G_OBJECT (bubble),
+ "style-set",
+ G_CALLBACK (on_style_set),
+ bubble);
+
gtk_widget_add_events (GTK_WIDGET (bubble), GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
atk_object_set_role (gtk_widget_get_accessible (GTK_WIDGET (bubble)), ATK_ROLE_ALERT);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]