2007-07-09 Matthew Allum <mallum@openedhand.com>

* TODO:
        Updates.
        * clutter/clutter-stage.c:
        * clutter/glx/clutter-stage-glx.c:
        Fix cursor visibility property.
        Force a repaint before mapping to attempt to avoid flicker.
This commit is contained in:
Matthew Allum
2007-07-09 22:59:52 +00:00
parent eeef27ca66
commit 071719ffa4
4 changed files with 30 additions and 6 deletions

View File

@@ -243,7 +243,7 @@ clutter_stage_class_init (ClutterStageClass *klass)
g_param_spec_boolean ("cursor-visible",
"Cursor Visible",
"Whether the mouse pointer is visible on the main stage ",
FALSE,
TRUE,
G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
g_object_class_install_property
@@ -423,7 +423,7 @@ clutter_stage_init (ClutterStage *self)
priv->is_offscreen = FALSE;
priv->is_fullscreen = FALSE;
priv->is_cursor_visible = FALSE;
priv->is_cursor_visible = TRUE;
priv->color.red = 0xff;
priv->color.green = 0xff;
@@ -723,7 +723,7 @@ clutter_stage_hide_cursor (ClutterStage *stage)
priv->is_cursor_visible = FALSE;
if (CLUTTER_STAGE_GET_CLASS (stage)->set_cursor_visible)
CLUTTER_STAGE_GET_CLASS (stage)->set_cursor_visible (stage, FALSE);
CLUTTER_STAGE_GET_CLASS (stage)->set_cursor_visible (stage, FALSE);
g_object_notify (G_OBJECT (stage), "cursor-visible");
}

View File

@@ -56,7 +56,14 @@ clutter_stage_glx_show (ClutterActor *actor)
ClutterStageGLX *stage_glx = CLUTTER_STAGE_GLX (actor);
if (stage_glx->xwin)
XMapWindow (stage_glx->xdpy, stage_glx->xwin);
{
/* Fire off a redraw to avoid flicker on first map.
* Appears not to work perfectly on intel drivers at least.
*/
clutter_redraw();
XSync (stage_glx->xdpy, FALSE);
XMapWindow (stage_glx->xdpy, stage_glx->xwin);
}
}
static void
@@ -112,6 +119,7 @@ clutter_stage_glx_unrealize (ClutterActor *actor)
stage_glx->gl_context = None;
}
XSync (stage_glx->xdpy, False);
clutter_glx_untrap_x_errors ();
}
@@ -413,7 +421,7 @@ clutter_stage_glx_set_cursor_visible (ClutterStage *stage,
if (stage_glx->xwin == None)
return;
CLUTTER_NOTE (MISC, "setting cursor state ('%s') over stage window (%u)",
CLUTTER_NOTE (BACKEND, "setting cursor state ('%s') over stage window (%u)",
show_cursor ? "visible" : "invisible",
(unsigned int) stage_glx->xwin);