[x11] Fix Stage user-initiated resize

The user-initiated resize is conflicting with the allocated size. This
happens because we change the size of the stage's X Window behind the
back of the size allocation machinery.

Instead, we should change the size of the actor whenever we receive a
ConfigureNotify event to reflect the new size of the actor.
This commit is contained in:
Emmanuele Bassi 2009-10-05 12:24:19 +01:00
parent e3c2ed0009
commit 111512a2a0
3 changed files with 9 additions and 5 deletions

View File

@ -479,8 +479,9 @@ event_translate (ClutterBackend *backend,
xevent->xconfigure.width, xevent->xconfigure.width,
xevent->xconfigure.height); xevent->xconfigure.height);
stage_x11->xwin_width = xevent->xconfigure.width; clutter_actor_set_size (CLUTTER_ACTOR (stage),
stage_x11->xwin_height = xevent->xconfigure.height; xevent->xconfigure.width,
xevent->xconfigure.height);
CLUTTER_UNSET_PRIVATE_FLAGS (stage_x11->wrapper, CLUTTER_UNSET_PRIVATE_FLAGS (stage_x11->wrapper,
CLUTTER_STAGE_IN_RESIZE); CLUTTER_STAGE_IN_RESIZE);
@ -489,8 +490,6 @@ event_translate (ClutterBackend *backend,
* to set up the GL viewport with the new size * to set up the GL viewport with the new size
*/ */
clutter_stage_ensure_viewport (stage); clutter_stage_ensure_viewport (stage);
clutter_actor_queue_relayout (CLUTTER_ACTOR (stage_x11->wrapper));
} }
res = FALSE; res = FALSE;
break; break;

View File

@ -194,6 +194,9 @@ clutter_stage_x11_resize (ClutterStageWindow *stage_window,
gint height) gint height)
{ {
ClutterStageX11 *stage_x11 = CLUTTER_STAGE_X11 (stage_window); ClutterStageX11 *stage_x11 = CLUTTER_STAGE_X11 (stage_window);
gboolean resize;
resize = clutter_stage_get_user_resizable (stage_x11->wrapper);
if (width == 0 || height == 0) if (width == 0 || height == 0)
{ {
@ -230,7 +233,8 @@ clutter_stage_x11_resize (ClutterStageWindow *stage_window,
stage_x11->xwin_height); stage_x11->xwin_height);
} }
clutter_stage_x11_fix_window_size (stage_x11, width, height); if (!resize)
clutter_stage_x11_fix_window_size (stage_x11, width, height);
if (stage_x11->xpixmap != None) if (stage_x11->xpixmap != None)
{ {

View File

@ -159,6 +159,7 @@ test_actors_main (int argc, char *argv[])
clutter_stage_set_title (CLUTTER_STAGE (stage), "Clone Test"); clutter_stage_set_title (CLUTTER_STAGE (stage), "Clone Test");
clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
clutter_stage_set_user_resizable (CLUTTER_STAGE (stage), TRUE);
oh = g_new (SuperOH, 1); oh = g_new (SuperOH, 1);
oh->stage = stage; oh->stage = stage;