[stage-x11] Set the geometry size for foreign wins
authorChris Lord <chris@linux.intel.com>
Tue, 16 Feb 2010 17:46:52 +0000 (17:46 +0000)
committerChris Lord <chris@linux.intel.com>
Tue, 16 Feb 2010 17:53:05 +0000 (17:53 +0000)
If we get into the resize function and it's a foreign window, set the
geometry size so that the allocate will set the backend size and call
glViewport.

clutter/x11/clutter-stage-x11.c

index 231546c..729e736 100644 (file)
@@ -200,6 +200,13 @@ clutter_stage_x11_resize (ClutterStageWindow *stage_window,
   ClutterStage *stage = stage_x11->wrapper;
   gboolean resize;
 
+  if (stage_x11->is_foreign_xwin)
+    {
+      stage_x11->xwin_width = width;
+      stage_x11->xwin_height = height;
+      return;
+    }
+
   /* If we're going fullscreen, don't mess with the size */
   if (stage_x11->fullscreening)
     return;
@@ -221,7 +228,7 @@ clutter_stage_x11_resize (ClutterStageWindow *stage_window,
 
   CLUTTER_NOTE (BACKEND, "New size received: (%d, %d)", width, height);
 
-  if (stage_x11->xwin != None && !stage_x11->is_foreign_xwin)
+  if (stage_x11->xwin != None)
     {
       clutter_stage_x11_fix_window_size (stage_x11, width, height);