From dd64ad1e4209793c436ad1cb90ba18ec85bbe936 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Fri, 20 Jan 2012 15:49:16 +0000 Subject: [PATCH] wayland: Support programmatically resizing the stage This will call into Cogl and ask it to resize the framebuffer which will then update the underlying EGL surface. --- clutter/wayland/clutter-stage-wayland.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/clutter/wayland/clutter-stage-wayland.c b/clutter/wayland/clutter-stage-wayland.c index 0555b2f87..099a30315 100644 --- a/clutter/wayland/clutter-stage-wayland.c +++ b/clutter/wayland/clutter-stage-wayland.c @@ -119,6 +119,18 @@ clutter_stage_wayland_set_fullscreen (ClutterStageWindow *stage_window, g_warning (G_STRLOC ": There is no Wayland API for un-fullscreening now"); } +static void +clutter_stage_wayland_resize (ClutterStageWindow *stage_window, + gint width, + gint height) +{ + ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window); + + /* Resize preserving top left */ + cogl_wayland_onscreen_resize (stage_cogl->onscreen, width, height, 0, 0); + _clutter_stage_window_redraw (stage_window); +} + static void clutter_stage_wayland_init (ClutterStageWayland *stage_wayland) { @@ -131,6 +143,7 @@ clutter_stage_window_iface_init (ClutterStageWindowIface *iface) iface->realize = clutter_stage_wayland_realize; iface->set_fullscreen = clutter_stage_wayland_set_fullscreen; + iface->resize = clutter_stage_wayland_resize; } static void