From 2bcb7d73beeba03e2d272121b1e3b9aa1d8c8ffd Mon Sep 17 00:00:00 2001 From: Tomas Frydrych Date: Wed, 20 Aug 2008 13:01:40 +0100 Subject: [PATCH] Handle resize on root window. --- src/compositor/compositor-clutter.c | 37 +++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/src/compositor/compositor-clutter.c b/src/compositor/compositor-clutter.c index dad1496c8..b1dcfe7f4 100644 --- a/src/compositor/compositor-clutter.c +++ b/src/compositor/compositor-clutter.c @@ -312,14 +312,14 @@ static gboolean meta_comp_window_has_shadow (MetaCompWindow *self); static void meta_comp_window_constructed (GObject *object) { - MetaCompWindow *self = META_COMP_WINDOW (object); - MetaCompWindowPrivate *priv = self->priv; - MetaScreen *screen = priv->screen; - MetaDisplay *display = meta_screen_get_display (screen); - Window xwindow = priv->xwindow; + MetaCompWindow *self = META_COMP_WINDOW (object); + MetaCompWindowPrivate *priv = self->priv; + MetaScreen *screen = priv->screen; + MetaDisplay *display = meta_screen_get_display (screen); + Window xwindow = priv->xwindow; Display *xdisplay = meta_display_get_xdisplay (display); + MetaCompScreen *info = meta_screen_get_compositor_data (screen); XRenderPictFormat *format; - MetaCompScreen *info = meta_screen_get_compositor_data (screen); meta_comp_window_get_window_type (self); @@ -1136,7 +1136,30 @@ process_configure_notify (MetaCompositorClutter *compositor, } else { - /* FIXME -- handle root window resizing */ + GSList *l = meta_display_get_screens (display); + + while (l) + { + MetaScreen *screen = l->data; + Window xroot = meta_screen_get_xroot (screen); + + if (event->window == xroot) + { + gint width; + gint height; + MetaCompScreen *info = meta_screen_get_compositor_data (screen); + + meta_screen_get_size (screen, &width, &height); + clutter_actor_set_size (info->stage, width, height); + + meta_verbose ("Changed size for stage on screen %d to %dx%d\n", + meta_screen_get_screen_number (screen), + width, height); + break; + } + + l = l->next; + } } }