When starting weston with parameter --enable-wrandr,
it will automatically load wrandr.so module. This is
for QA testing and Admin configuration.

Signed-off-by: Quanxian Wang <quanxian.w...@intel.com>
---
 src/compositor.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/compositor.c b/src/compositor.c
index c031edc..0d37ab8 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -88,7 +88,7 @@ sigchld_handler(int signal_number, void *data)
        return 1;
 }
 
-static void
+WL_EXPORT void
 weston_output_transform_scale_init(struct weston_output *output,
                                   uint32_t transform, uint32_t scale);
 
@@ -3297,7 +3297,7 @@ weston_output_update_matrix(struct weston_output *output)
        output->dirty = 0;
 }
 
-static void
+WL_EXPORT void
 weston_output_transform_scale_init(struct weston_output *output, uint32_t 
transform, uint32_t scale)
 {
        output->transform = transform;
@@ -4140,6 +4140,7 @@ int main(int argc, char *argv[])
        char *log = NULL;
        int32_t idle_time = 300;
        int32_t help = 0;
+       int32_t enable_wrandr = 0;
        char *socket_name = "wayland-0";
        int32_t version = 0;
        struct weston_config *config;
@@ -4151,6 +4152,7 @@ int main(int argc, char *argv[])
                { WESTON_OPTION_STRING, "socket", 'S', &socket_name },
                { WESTON_OPTION_INTEGER, "idle-time", 'i', &idle_time },
                { WESTON_OPTION_STRING, "modules", 0, &option_modules },
+               { WESTON_OPTION_STRING, "enable-wrandr", 0, &enable_wrandr},
                { WESTON_OPTION_STRING, "log", 0, &log },
                { WESTON_OPTION_BOOLEAN, "help", 'h', &help },
                { WESTON_OPTION_BOOLEAN, "version", 0, &version },
@@ -4233,6 +4235,14 @@ int main(int argc, char *argv[])
        ec->idle_time = idle_time;
        ec->default_pointer_grab = NULL;
 
+       /* Add wrandr modules */
+       if (enable_wrandr) {
+               if (!option_modules)
+                       option_modules = strdup("wrandr.so");
+               else
+                       option_modules = strcat(option_modules, ",wrandr.so");
+       }
+
        setenv("WAYLAND_DISPLAY", socket_name, 1);
 
        if (option_shell)
-- 
1.8.1.2

_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to