[PATCH 1/9] add multi-screen-mode option to weston.ini
Xiong Zhang
xiong.y.zhang at intel.com
Tue Sep 17 20:50:56 PDT 2013
multi-screen-mode=clone/extend to control multi screen mode
Signed-off-by: Xiong Zhang <xiong.y.zhang at intel.com>
---
src/compositor.c | 9 +++++++++
src/compositor.h | 7 +++++++
weston.ini | 1 +
3 files changed, 17 insertions(+)
diff --git a/src/compositor.c b/src/compositor.c
index 6a53984..f9e9ba1 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -2886,6 +2886,7 @@ weston_compositor_init(struct weston_compositor *ec,
struct wl_event_loop *loop;
struct xkb_rule_names xkb_names;
struct weston_config_section *s;
+ char *mode;
ec->config = config;
ec->wl_display = display;
@@ -2940,6 +2941,14 @@ weston_compositor_init(struct weston_compositor *ec,
if (weston_compositor_xkb_init(ec, &xkb_names) < 0)
return -1;
+ s = weston_config_get_section(ec->config, "core", NULL, NULL);
+ weston_config_section_get_string(s, "multi-screen-mode",
+ &mode, "extend");
+ if (!strcmp("clone", mode))
+ ec->multiscreen_mode = WESTON_MULTISCREEN_CLONE;
+ else
+ ec->multiscreen_mode = WESTON_MULTISCREEN_EXTEND;
+
ec->ping_handler = NULL;
screenshooter_create(ec);
diff --git a/src/compositor.h b/src/compositor.h
index 3437aea..a3171f0 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -520,6 +520,11 @@ enum weston_capability {
WESTON_CAP_CAPTURE_YFLIP = 0x0002,
};
+enum weston_multiscreen_mode {
+ WESTON_MULTISCREEN_EXTEND = 0x1,
+ WESTON_MULTISCREEN_CLONE = 0x2,
+};
+
struct weston_compositor {
struct wl_signal destroy_signal;
@@ -582,6 +587,8 @@ struct weston_compositor {
int launcher_sock;
uint32_t output_id_pool;
+ enum weston_multiscreen_mode multiscreen_mode;
+ struct weston_output *primary_output;
struct xkb_rule_names xkb_names;
struct xkb_context *xkb_context;
diff --git a/weston.ini b/weston.ini
index f2abceb..d4458d4 100644
--- a/weston.ini
+++ b/weston.ini
@@ -1,5 +1,6 @@
[core]
#modules=desktop-shell.so,xwayland.so,cms-colord.so
+#multi-screen-mode=clone
[shell]
background-image=/usr/share/backgrounds/gnome/Aqua.jpg
--
1.8.3.2
More information about the wayland-devel
mailing list