From 7c640580216d88e19c0e5443f6c725c66443efe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shanti=20Bouchez-Mongard=C3=A9?= Date: Wed, 7 Jan 2015 14:35:09 +0100 Subject: [PATCH] Add option in weston.ini to enable/disable Glamor on XWayland Option is enable_glamor=true|false in section [xwayland]. Default is true. When setting to false, pass '-shm' option to XWayland executable. --- weston.ini.in | 3 +++ xwayland/launcher.c | 5 +++++ xwayland/xwayland.h | 1 + 3 files changed, 9 insertions(+) diff --git a/weston.ini.in b/weston.ini.in index 4fca0bb..d0c03d2 100644 --- a/weston.ini.in +++ b/weston.ini.in @@ -3,6 +3,9 @@ #shell=desktop-shell.so #gbm-format=xrgb2101010 +[xwayland] +#enable_glamor=true + [shell] background-image=/usr/share/backgrounds/gnome/Aqua.jpg background-color=0xff002244 diff --git a/xwayland/launcher.c b/xwayland/launcher.c index df2efd2..d7e65b5 100644 --- a/xwayland/launcher.c +++ b/xwayland/launcher.c @@ -116,6 +116,7 @@ weston_xserver_handle_event(int listen_fd, uint32_t mask, void *data) "-listen", unix_fd, "-wm", wm_fd, "-terminate", + (wxs->enable_glamor ? NULL : "-shm"), NULL) < 0) weston_log("exec of '%s %s -rootless " "-listen %s -listen %s -wm %s " @@ -351,6 +352,7 @@ module_init(struct weston_compositor *compositor, { struct wl_display *display = compositor->wl_display; struct weston_xserver *wxs; + struct weston_config_section *xconfig; char lockfile[256], display_name[8]; wxs = zalloc(sizeof *wxs); @@ -362,6 +364,9 @@ module_init(struct weston_compositor *compositor, wxs->display = 0; + xconfig = weston_config_get_section(compositor->config, "xwayland", NULL, NULL); + weston_config_section_get_bool(xconfig, "enable_glamor", &wxs->enable_glamor, 1); + retry: if (create_lockfile(wxs->display, lockfile, sizeof lockfile) < 0) { if (errno == EAGAIN) { diff --git a/xwayland/xwayland.h b/xwayland/xwayland.h index 312c9b2..d2b9375 100644 --- a/xwayland/xwayland.h +++ b/xwayland/xwayland.h @@ -48,6 +48,7 @@ struct weston_xserver { struct weston_compositor *compositor; struct weston_wm *wm; struct wl_listener destroy_listener; + int enable_glamor; }; struct weston_wm { -- 2.2.1