From 3771ef2f08054770ebc6110de14efd8fa2de3a26 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Mon, 31 Aug 2015 22:55:57 +0100 Subject: [PATCH] gdk: stage: report geometry of the underlying surface for foreign windows When running on wayland, we might have our own subsurface desynchronized from the foreign GdkWindow. It is important that we report the size of the actually surface we're rendering to, otherwise the logic in ClutterStage might discard resize operation that resynchronize the subsurface with the stage's size. https://bugzilla.gnome.org/show_bug.cgi?id=754697 --- clutter/gdk/clutter-stage-gdk.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/clutter/gdk/clutter-stage-gdk.c b/clutter/gdk/clutter-stage-gdk.c index 3ab4b1e78..953c2b7bb 100644 --- a/clutter/gdk/clutter-stage-gdk.c +++ b/clutter/gdk/clutter-stage-gdk.c @@ -122,16 +122,21 @@ clutter_stage_gdk_get_geometry (ClutterStageWindow *stage_window, { ClutterStageGdk *stage_gdk = CLUTTER_STAGE_GDK (stage_window); - if (stage_gdk->window != NULL) + if (!stage_gdk->foreign_window) { - geometry->width = gdk_window_get_width (stage_gdk->window); - geometry->height = gdk_window_get_height (stage_gdk->window); + if (stage_gdk->window != NULL) + { + geometry->width = gdk_window_get_width (stage_gdk->window); + geometry->height = gdk_window_get_height (stage_gdk->window); + } + else + { + geometry->width = 640; + geometry->height = 480; + } } else - { - geometry->width = 640; - geometry->height = 480; - } + clutter_stage_window_parent_iface->get_geometry (stage_window, geometry); } static void