[PATCH] X server talking to wayland uses xwayland.conf instead of xorg.conf

spitzak at gmail.com spitzak at gmail.com
Mon Mar 4 21:42:13 PST 2013


From: spitzak <spitzak at gmail.com>

This allows X applications to be run on wayland without having to
delete conf files needed to run the legacy X server on the same machine.

Currently you must use an xwayland.conf file if the wlshm x driver is
necessary.

I patched the xorg server rather than the xserver weston module
because:

 1. It is already patched to take a "--wayland" switch.

 2. A patch was required to stop it from reading xorg.conf.d. This
version also prevents that if --configdir is given, a more complex
patch could be used if there is concern about this being an incompatable
change.
---
 hw/xfree86/common/xf86Config.c |    7 +++++--
 hw/xfree86/common/xf86Init.c   |    4 ++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 3934ff0..a4f7f97 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -2386,8 +2386,11 @@ xf86HandleConfigFile(Bool autoconfig)
             dirfrom = X_CMDLINE;
 
         xf86initConfigFiles();
-        sysdirname = xf86openConfigDirFiles(SYS_CONFIGDIRPATH, NULL,
-                                            PROJECTROOT);
+        if (xf86ConfigDir)
+          sysdirname = 0;
+        else
+          sysdirname = xf86openConfigDirFiles(SYS_CONFIGDIRPATH, NULL,
+                                              PROJECTROOT);
         dirname = xf86openConfigDirFiles(dirsearch, xf86ConfigDir, PROJECTROOT);
         filename = xf86openConfigFile(filesearch, xf86ConfigFile, PROJECTROOT);
         if (filename) {
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index a062929..b2a668c 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -1412,6 +1412,10 @@ ddxProcessArgument(int argc, char **argv, int i)
   if (!strcmp(argv[i], "-wayland"))
   {
     xorgWayland = TRUE;
+    if (!xf86ConfigFile)
+      xf86ConfigFile = "xwayland.conf";
+    if (!xf86ConfigDir)
+      xf86ConfigDir = "xwayland.conf.d";
     return 1;
   }
 
-- 
1.7.9.5



More information about the wayland-devel mailing list