[clutter-gtk] embed: Install the filter just once
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter-gtk] embed: Install the filter just once
- Date: Mon, 24 Oct 2011 16:34:47 +0000 (UTC)
commit b2ff434dded8b700c2c064dcb44c4a9ef3f1a2be
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Mon Oct 24 17:33:41 2011 +0100
embed: Install the filter just once
Don't install a global filter multiple times: once is enough, all the
heavy lifting is done by Clutter anyway.
clutter-gtk/gtk-clutter-embed.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/clutter-gtk/gtk-clutter-embed.c b/clutter-gtk/gtk-clutter-embed.c
index 2c81356..7cabfe5 100644
--- a/clutter-gtk/gtk-clutter-embed.c
+++ b/clutter-gtk/gtk-clutter-embed.c
@@ -207,6 +207,8 @@ gtk_clutter_embed_realize (GtkWidget *widget)
gint attributes_mask;
gint border_width;
+ static gboolean filter_installed = FALSE;
+
#ifdef HAVE_CLUTTER_GTK_X11
{
const XVisualInfo *xvinfo;
@@ -272,7 +274,11 @@ gtk_clutter_embed_realize (GtkWidget *widget)
style_context = gtk_widget_get_style_context (widget);
gtk_style_context_set_background (style_context, window);
- gdk_window_add_filter (NULL, gtk_clutter_filter_func, widget);
+ if (G_UNLIKELY (!filter_installed))
+ {
+ filter_installed = TRUE;
+ gdk_window_add_filter (NULL, gtk_clutter_filter_func, widget);
+ }
#if defined(HAVE_CLUTTER_GTK_X11)
clutter_x11_set_stage_foreign (CLUTTER_STAGE (priv->stage),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]