From 939ce2877cc650086bed6df611f8d1f0dc1909f4 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Sat, 15 Jul 2006 22:47:37 +0000 Subject: [PATCH] 2006-07-15 Emmanuele Bassi * clutter/clutter-main.c: (clutter_main): Destroy the main stage, instead of unreffing it. (clutter_init): Ref and sink the main stage, as it is a top level actor. * clutter/clutter-stage.c (clutter_stage_unrealize): Access the Window private member directly, instead of calling the get_xwindow method. * examples/test.c (main): Quit on button press. --- ChangeLog | 15 +++++++++++++++ clutter/clutter-main.c | 3 ++- clutter/clutter-stage.c | 5 ++--- examples/test.c | 5 ++++- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 82a75ef7d..9052b4706 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2006-07-15 Emmanuele Bassi + + * clutter/clutter-main.c: + + (clutter_main): Destroy the main stage, instead of unreffing it. + + (clutter_init): Ref and sink the main stage, as it is a top + level actor. + + * clutter/clutter-stage.c (clutter_stage_unrealize): Access + the Window private member directly, instead of calling the + get_xwindow method. + + * examples/test.c (main): Quit on button press. + 2006-07-09 Emmanuele Bassi * clutter/clutter-event.h: Change the name of the diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c index 3057bd2a9..a702b768b 100644 --- a/clutter/clutter-main.c +++ b/clutter/clutter-main.c @@ -391,7 +391,7 @@ clutter_main (void) if (context->main_loop_level == 0) { - g_object_unref (context->stage); + clutter_actor_destroy (CLUTTER_ACTOR (context->stage)); g_free (context); } } @@ -571,6 +571,7 @@ clutter_init (int *argc, char ***argv) context->stage = CLUTTER_STAGE (clutter_stage_get_default ()); g_return_val_if_fail (CLUTTER_IS_STAGE (context->stage), -3); + g_object_ref_sink (context->stage); clutter_actor_realize (CLUTTER_ACTOR (context->stage)); g_return_val_if_fail diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c index 2eb13c65f..216ad348c 100644 --- a/clutter/clutter-stage.c +++ b/clutter/clutter-stage.c @@ -262,8 +262,6 @@ clutter_stage_unrealize (ClutterActor *actor) if (priv->want_offscreen) { - - if (priv->glxpixmap) { glXDestroyGLXPixmap (clutter_xdisplay(), priv->glxpixmap); @@ -278,7 +276,7 @@ clutter_stage_unrealize (ClutterActor *actor) } else { - if (clutter_stage_get_xwindow (CLUTTER_STAGE(actor))) + if (priv->xwin) { XDestroyWindow (clutter_xdisplay(), priv->xwin); priv->xwin = None; @@ -771,6 +769,7 @@ clutter_stage_get_default (void) if (!stage_singleton) { stage_singleton = g_object_new (CLUTTER_TYPE_STAGE, NULL); + retval = CLUTTER_ACTOR (stage_singleton); } else diff --git a/examples/test.c b/examples/test.c index a6614cb83..30c24972d 100644 --- a/examples/test.c +++ b/examples/test.c @@ -72,7 +72,10 @@ main (int argc, char *argv[]) clutter_init (&argc, &argv); stage = clutter_stage_get_default (); - + g_signal_connect (stage, "button-press-event", + G_CALLBACK (clutter_main_quit), + NULL); + pixbuf = gdk_pixbuf_new_from_file ("clutter-logo-800x600.png", NULL); if (!pixbuf)