From 29cc027f069c9ad900b9044cd40075c2d17be736 Mon Sep 17 00:00:00 2001 From: Chris Lord Date: Sat, 6 Feb 2010 16:47:22 +0100 Subject: [PATCH] [x11] Don't set actor size on ConfigureNotify Calling clutter_actor_set_size in response to ConfigureNotify makes setting the size of the stage racy - the most common result of which seems to be that you can't set the stage dimensions to anything less than 640x480. Instead, add a first_allocation bit to the private structure of the X11 stage and force the first resize (necessary or the default stage will be a 1x1 window). --- clutter/x11/clutter-event-x11.c | 4 ---- clutter/x11/clutter-stage-x11.c | 5 ++++- clutter/x11/clutter-stage-x11.h | 1 + 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/clutter/x11/clutter-event-x11.c b/clutter/x11/clutter-event-x11.c index 1a3a260..4645b63 100644 --- a/clutter/x11/clutter-event-x11.c +++ b/clutter/x11/clutter-event-x11.c @@ -485,10 +485,6 @@ event_translate (ClutterBackend *backend, xevent->xconfigure.width, xevent->xconfigure.height); - clutter_actor_set_size (CLUTTER_ACTOR (stage), - xevent->xconfigure.width, - xevent->xconfigure.height); - CLUTTER_UNSET_PRIVATE_FLAGS (stage_x11->wrapper, CLUTTER_STAGE_IN_RESIZE); diff --git a/clutter/x11/clutter-stage-x11.c b/clutter/x11/clutter-stage-x11.c index 754dcc2..f0d57bd 100644 --- a/clutter/x11/clutter-stage-x11.c +++ b/clutter/x11/clutter-stage-x11.c @@ -220,10 +220,12 @@ clutter_stage_x11_resize (ClutterStageWindow *stage_window, CLUTTER_NOTE (BACKEND, "New size received: (%d, %d)", width, height); if (width != stage_x11->xwin_width || - height != stage_x11->xwin_height) + height != stage_x11->xwin_height || + stage_x11->first_allocation) { stage_x11->xwin_width = width; stage_x11->xwin_height = height; + stage_x11->first_allocation = FALSE; if (stage_x11->xwin != None && !stage_x11->is_foreign_xwin) { @@ -659,6 +661,7 @@ clutter_stage_x11_init (ClutterStageX11 *stage) stage->xwin = None; stage->xwin_width = 640; stage->xwin_height = 480; + stage->first_allocation = TRUE; stage->wm_state = STAGE_X11_WITHDRAWN; diff --git a/clutter/x11/clutter-stage-x11.h b/clutter/x11/clutter-stage-x11.h index 71b66e3..a10c0d9 100644 --- a/clutter/x11/clutter-stage-x11.h +++ b/clutter/x11/clutter-stage-x11.h @@ -54,6 +54,7 @@ struct _ClutterStageX11 guint fullscreen_on_map : 1; guint is_cursor_visible : 1; guint viewport_initialized : 1; + guint first_allocation : 1; Window xwin; gint xwin_width; -- 2.7.4