From c2d724a2cd17073d41848826c30e75b942884313 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 30 Nov 2006 14:45:19 +0000 Subject: [PATCH] 2006-11-30 Emmanuele Bassi * clutter/clutter-stage.h: * clutter/clutter-stage.c: (clutter_stage_swap_buffers): Remove, as the same is done via clutter_redraw() and clutter_actor_queue_redraw(). (clutter_stage_unrealize), (clutter_stage_init), (clutter_stage_set_xwindow_foreign): Do not call XDestroyWindow() on the stage Window if we are using a foreign Window, as we don't control its lifetime. --- ChangeLog | 12 ++++++++++++ clutter/clutter-stage.c | 22 +++++++--------------- clutter/clutter-stage.h | 1 - 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index fad3392a4..111a8fee1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2006-11-30 Emmanuele Bassi + + * clutter/clutter-stage.h: + * clutter/clutter-stage.c: + (clutter_stage_swap_buffers): Remove, as the same is done + via clutter_redraw() and clutter_actor_queue_redraw(). + + (clutter_stage_unrealize), (clutter_stage_init), + (clutter_stage_set_xwindow_foreign): Do not call + XDestroyWindow() on the stage Window if we are using a + foreign Window, as we don't control its lifetime. + 2006-11-30 Emmanuele Bassi * Makefile.am: Remove the gtk directory from the SUBDIRS. diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c index 899910fb7..5c9341f2d 100644 --- a/clutter/clutter-stage.c +++ b/clutter/clutter-stage.c @@ -71,6 +71,7 @@ struct _ClutterStagePrivate guint want_fullscreen : 1; guint want_offscreen : 1; guint hide_cursor : 1; + guint is_foreign_xwin : 1; }; enum @@ -277,11 +278,13 @@ clutter_stage_unrealize (ClutterActor *actor) } else { - if (priv->xwin != None) + if (!priv->is_foreign_xwin && priv->xwin != None) { XDestroyWindow (clutter_xdisplay(), priv->xwin); priv->xwin = None; } + else + priv->xwin = None; } glXMakeCurrent(clutter_xdisplay(), None, NULL); @@ -786,6 +789,8 @@ clutter_stage_init (ClutterStage *self) priv->want_offscreen = FALSE; priv->want_fullscreen = FALSE; priv->hide_cursor = FALSE; + priv->is_foreign_xwin = FALSE; + priv->xwin = None; priv->gl_context = None; @@ -906,6 +911,7 @@ clutter_stage_set_xwindow_foreign (ClutterStage *stage, clutter_actor_unrealize (CLUTTER_ACTOR (stage)); priv->xwin = xid; + priv->is_foreign_xwin = TRUE; geom.x = x; geom.y = y; @@ -1137,17 +1143,3 @@ clutter_stage_get_actor_at_pos (ClutterStage *stage, return found; } - -void -clutter_stage_swap_buffers (ClutterStage *stage) -{ - ClutterStagePrivate *priv; - ClutterMainContext *context; - - g_return_if_fail (CLUTTER_IS_STAGE (stage)); - - priv = stage->priv; - context = clutter_context_get_default (); - - glXSwapBuffers (context->xdpy, stage->priv->xwin); -} diff --git a/clutter/clutter-stage.h b/clutter/clutter-stage.h index 113472846..94937f93e 100644 --- a/clutter/clutter-stage.h +++ b/clutter/clutter-stage.h @@ -125,7 +125,6 @@ GdkPixbuf * clutter_stage_snapshot (ClutterStage *stage, gint width, gint height); const XVisualInfo * clutter_stage_get_xvisual (ClutterStage *stage); -void clutter_stage_swap_buffers (ClutterStage *stage); G_END_DECLS