mirror of
https://github.com/brl/mutter.git
synced 2025-02-17 05:44:08 +00:00
[stage] Get the current size correctly
Get the current size of the stage correctly in clutter_stage_set_minimum_size. The get_geometry StageWindow function is not equivalent of the current size, use clutter_actor_get_size().
This commit is contained in:
parent
be11564b55
commit
27e33aa14f
@ -2344,7 +2344,7 @@ clutter_stage_set_minimum_size (ClutterStage *stage,
|
|||||||
guint height)
|
guint height)
|
||||||
{
|
{
|
||||||
gboolean resize;
|
gboolean resize;
|
||||||
ClutterGeometry geom;
|
gfloat current_width, current_height;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
||||||
g_return_if_fail ((width > 0) && (height > 0));
|
g_return_if_fail ((width > 0) && (height > 0));
|
||||||
@ -2356,17 +2356,19 @@ clutter_stage_set_minimum_size (ClutterStage *stage,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
resize = FALSE;
|
resize = FALSE;
|
||||||
_clutter_stage_window_get_geometry (stage->priv->impl, &geom);
|
clutter_actor_get_size (CLUTTER_ACTOR (stage),
|
||||||
|
¤t_width,
|
||||||
|
¤t_height);
|
||||||
|
|
||||||
if (geom.width < width)
|
if ((guint)current_width < width)
|
||||||
resize = TRUE;
|
resize = TRUE;
|
||||||
else
|
else
|
||||||
width = geom.width;
|
width = (guint)current_width;
|
||||||
|
|
||||||
if (geom.height < height)
|
if ((guint)current_height < height)
|
||||||
resize = TRUE;
|
resize = TRUE;
|
||||||
else
|
else
|
||||||
height = geom.height;
|
height = (guint)current_height;
|
||||||
|
|
||||||
if (resize)
|
if (resize)
|
||||||
_clutter_stage_window_resize (stage->priv->impl, width, height);
|
_clutter_stage_window_resize (stage->priv->impl, width, height);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user