[mutter/wip/wayland] wayland: Handle clutter stage size not matching request
- From: Robert Bragg <rbragg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/wayland] wayland: Handle clutter stage size not matching request
- Date: Wed, 25 Jan 2012 14:37:06 +0000 (UTC)
commit b7b9e5443a3680584750d8b7f31d07198fd1f163
Author: Robert Bragg <robert linux intel com>
Date: Wed Jan 25 11:51:08 2012 +0000
wayland: Handle clutter stage size not matching request
When creating the wayland output object we resize the ClutterStage to
match the requested size but if we are running on KMS then the stage
will be forced to have a size matching the display resolution. This
ensures we read back the stage size after setting it to get the real
stage size and we use that size to setup the wayland output object.
src/wayland/meta-wayland.c | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
index 83d5687..c072d4a 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -521,6 +521,20 @@ meta_wayland_compositor_create_output (MetaWaylandCompositor *compositor,
{
MetaWaylandOutput *output = g_slice_new0 (MetaWaylandOutput);
MetaWaylandMode *mode;
+ float final_width, final_height;
+
+ /* XXX: eventually we will support sliced stages and an output should
+ * correspond to a slice/CoglFramebuffer, but for now we only support
+ * one output so we make sure it always matches the size of the stage
+ */
+ clutter_actor_set_size (compositor->stage, width, height);
+
+ /* Read back the actual size we were given.
+ * XXX: This really needs re-thinking later though so we know the
+ * correct output geometry to use. */
+ clutter_actor_get_size (compositor->stage, &final_width, &final_height);
+ width = final_width;
+ height = final_height;
output->wayland_output.interface = &wl_output_interface;
@@ -541,11 +555,6 @@ meta_wayland_compositor_create_output (MetaWaylandCompositor *compositor,
mode->refresh = 60;
output->modes = g_list_prepend (output->modes, mode);
- /* XXX: eventually we will support sliced stages and an output should
- * correspond to a slice/CoglFramebuffer, but for now we only support
- * one output so we make sure it always matches the size of the stage
- */
- clutter_actor_set_size (compositor->stage, width, height);
compositor->outputs = g_list_prepend (compositor->outputs, output);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]