[clutter-gtk] embed: Set up a better initial state
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter-gtk] embed: Set up a better initial state
- Date: Mon, 24 Oct 2011 14:44:54 +0000 (UTC)
commit e31baffd63dd9533eab4ca752f720bbbd0e1322f
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Mon Oct 24 15:38:45 2011 +0100
embed: Set up a better initial state
The GtkClutterEmbed widget should turn on the APP_PAINTABLE flag, since
it's responsible for painting everything, including the background.
It should also set the h-expand and v-expand properties to TRUE, as the
container of the widget should allocate all the extra space; this allows
us to get rid of the explicit set_size_request() in a bunch of places.
clutter-gtk/gtk-clutter-embed.c | 23 +++++++++++++++++------
1 files changed, 17 insertions(+), 6 deletions(-)
---
diff --git a/clutter-gtk/gtk-clutter-embed.c b/clutter-gtk/gtk-clutter-embed.c
index 9977ed7..2c81356 100644
--- a/clutter-gtk/gtk-clutter-embed.c
+++ b/clutter-gtk/gtk-clutter-embed.c
@@ -630,16 +630,27 @@ static void
gtk_clutter_embed_init (GtkClutterEmbed *embed)
{
GtkClutterEmbedPrivate *priv;
+ GtkWidget *widget;
embed->priv = priv = GTK_CLUTTER_EMBED_GET_PRIVATE (embed);
- gtk_widget_set_can_focus (GTK_WIDGET (embed), TRUE);
- gtk_widget_set_has_window (GTK_WIDGET (embed), TRUE);
+ widget = GTK_WIDGET (embed);
+
+ /* we have a real window backing our drawing */
+ gtk_widget_set_has_window (widget, TRUE);
- /* disable double-buffering: it's automatically provided
- * by OpenGL
- */
- gtk_widget_set_double_buffered (GTK_WIDGET (embed), FALSE);
+ /* we accept key focus */
+ gtk_widget_set_can_focus (widget, TRUE);
+
+ /* disable double-buffering: it's automatically provided by OpenGL */
+ gtk_widget_set_double_buffered (widget, FALSE);
+
+ /* we own the whole drawing of this widget, including the background */
+ gtk_widget_set_app_paintable (widget, TRUE);
+
+ /* this widget should expand in both directions */
+ gtk_widget_set_hexpand (widget, TRUE);
+ gtk_widget_set_vexpand (widget, TRUE);
/* we always create new stages rather than use the default */
priv->stage = clutter_stage_new ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]