[clutter-gtk] embed: queue a draw on actors when embed state flag change
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter-gtk] embed: queue a draw on actors when embed state flag change
- Date: Tue, 6 Mar 2012 22:04:19 +0000 (UTC)
commit bf3397b588e0209486945e4bd71d28c5dc2e1497
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Tue Mar 6 16:53:51 2012 -0500
embed: queue a draw on actors when embed state flag change
When we receive a state-flags-changed signal, we should queue a draw on
all of our children, since their appearance might be depending on
inherited style values that changed.
This should really be done generically by GTK, but doing it there is
very bad for performance with the current GTK code, so we do it here.
clutter-gtk/gtk-clutter-embed.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/clutter-gtk/gtk-clutter-embed.c b/clutter-gtk/gtk-clutter-embed.c
index 0863f28..ea4658e 100644
--- a/clutter-gtk/gtk-clutter-embed.c
+++ b/clutter-gtk/gtk-clutter-embed.c
@@ -669,6 +669,17 @@ gtk_clutter_embed_event (GtkWidget *widget,
}
static void
+gtk_clutter_embed_state_flags_changed (GtkWidget *widget,
+ GtkStateFlags prev_state_flags)
+{
+ GTK_WIDGET_CLASS (gtk_clutter_embed_parent_class)->state_flags_changed
+ (widget, prev_state_flags);
+
+ gtk_container_forall (GTK_CONTAINER (widget),
+ (GtkCallback) gtk_widget_queue_draw, NULL);
+}
+
+static void
gtk_clutter_embed_class_init (GtkClutterEmbedClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
@@ -693,6 +704,7 @@ gtk_clutter_embed_class_init (GtkClutterEmbedClass *klass)
widget_class->key_press_event = gtk_clutter_embed_key_event;
widget_class->key_release_event = gtk_clutter_embed_key_event;
widget_class->event = gtk_clutter_embed_event;
+ widget_class->state_flags_changed = gtk_clutter_embed_state_flags_changed;
container_class->add = gtk_clutter_embed_add;
container_class->remove = gtk_clutter_embed_remove;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]