[clutter] x11: adjust size to minimal size when realizing



commit d31bd6fe927dc5fd8a9c48695efc88d3e8ddabb5
Author: Lionel Landwerlin <llandwerlin gmail com>
Date:   Tue Jan 24 12:45:52 2012 +0000

    x11: adjust size to minimal size when realizing
    
    If you execute the following sequence :
    
    stage = clutter_stage_new ();
    clutter_actor_set_size (stage, 1280, 800);
    clutter_actor_realize (stage);
    
    Then you end up creating an onscreen buffer of size 1280x800 but
    ClutterStageX11 storing the stage size at 640x480.
    
    This patch resync the 2 implementation by using the ClutterStage's
    size in both classes when realizing.
    
    Signed-off-by: Lionel Landwerlin <llandwerlin gmail com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=667540

 clutter/x11/clutter-stage-x11.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/clutter/x11/clutter-stage-x11.c b/clutter/x11/clutter-stage-x11.c
index 8dce848..cb07c16 100644
--- a/clutter/x11/clutter-stage-x11.c
+++ b/clutter/x11/clutter-stage-x11.c
@@ -435,6 +435,11 @@ clutter_stage_x11_realize (ClutterStageWindow *stage_window)
   stage_cogl->onscreen = cogl_onscreen_new (backend->cogl_context,
                                             width, height);
 
+  /* We just created a window of the size of the actor. No need to fix
+     the size of the stage, just update it. */
+  stage_x11->xwin_width = width;
+  stage_x11->xwin_height = height;
+
   if (stage_x11->xwin != None)
     {
       cogl_x11_onscreen_set_foreign_window_xid (stage_cogl->onscreen,
@@ -500,7 +505,6 @@ clutter_stage_x11_realize (ClutterStageWindow *stage_window)
                                                stage_cogl->wrapper,
                                                event_flags);
 
-  /* no user resize.. */
   clutter_stage_x11_fix_window_size (stage_x11,
                                      stage_x11->xwin_width,
                                      stage_x11->xwin_height);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]