[mutter/wip/wayland] meta-wayland: Create a single mode for the output



commit c94854c37dacb52078f6f59bcef31aa66b335b76
Author: Robert Bragg <robert linux intel com>
Date:   Thu Jan 12 00:12:14 2012 +0000

    meta-wayland: Create a single mode for the output
    
    Make sure we post an output mode when clients bind to the output
    objects. This is important for xwayland because it uses the mode to
    setup xrandr modes which in turn affect the size of the screen which
    needs to match with the compositors output resolution otherwise we get
    problems with redirecting input events to x applications.
    
    This fixes redirecting input events outside the previous minimum
    xwayland screen size of 320x200.

 src/wayland/meta-wayland.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
index fcd5d22..e07e34b 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -444,10 +444,13 @@ static void
 meta_wayland_compositor_create_output (MetaWaylandCompositor *compositor,
                                        int x,
                                        int y,
+                                       int width,
+                                       int height,
                                        int width_mm,
                                        int height_mm)
 {
   MetaWaylandOutput *output = g_slice_new0 (MetaWaylandOutput);
+  MetaWaylandMode *mode;
 
   output->wayland_output.interface = &wl_output_interface;
 
@@ -461,6 +464,13 @@ meta_wayland_compositor_create_output (MetaWaylandCompositor *compositor,
                          output,
                          bind_output);
 
+  mode = g_slice_new0 (MetaWaylandMode);
+  mode->flags = 0;
+  mode->width = width;
+  mode->height = height;
+  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
@@ -1053,7 +1063,7 @@ meta_wayland_init (void)
   g_signal_connect (compositor->stage, "event",
                     G_CALLBACK (event_cb), compositor);
 
-  meta_wayland_compositor_create_output (compositor, 0, 0, 800, 600);
+  meta_wayland_compositor_create_output (compositor, 0, 0, 800, 600, 800, 600);
 
   if (wl_display_add_global (compositor->wayland_display, &wl_shell_interface,
                              compositor, bind_shell) == NULL)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]