[remoting] Pass -configdir to Xorg.

This CL updates the Xorg command-line to use -configdir instead of
-config. This ensures that Xorg does not read system config files in
/etc/X11/xorg.conf.d/ which may clash with the custom config.

Bug: b/285636547
Change-Id: I1a9198f028c3ff0cfaaa054d27928452bdccd41f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5641454
Reviewed-by: Erik Jensen <rkjnsn@chromium.org>
Auto-Submit: Lambros Lambrou <lambroslambrou@chromium.org>
Commit-Queue: Erik Jensen <rkjnsn@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1319438}
diff --git a/remoting/host/linux/linux_me2me_host.py b/remoting/host/linux/linux_me2me_host.py
index 1eb385e..40ebcfb 100755
--- a/remoting/host/linux/linux_me2me_host.py
+++ b/remoting/host/linux/linux_me2me_host.py
@@ -1452,9 +1452,8 @@
       self.randr_add_sizes = True
 
   def _launch_xorg(self, display, x_auth_file, extra_x_args):
-    with tempfile.NamedTemporaryFile(
-        prefix="chrome_remote_desktop_",
-        suffix=".conf", delete=False) as config_file:
+    config_dir = tempfile.mkdtemp(prefix="chrome_remote_desktop_")
+    with open(os.path.join(config_dir, "xorg.conf"), "wb") as config_file:
       config_file.write(gen_xorg_config().encode())
 
     self.server_supports_randr = True
@@ -1480,7 +1479,7 @@
          # so the equivalent information gets logged in our main log file.
          "-logfile", "/dev/null",
          "-verbose", "3",
-         "-config", config_file.name
+         "-configdir", config_dir
         ] + extra_x_args, env=self._x_env())
     if not self.server_proc.pid:
       raise Exception("Could not start Xorg.")
@@ -2043,6 +2042,7 @@
     g_desktop.cleanup()
     if getattr(g_desktop, 'xorg_conf', None) is not None:
       os.remove(g_desktop.xorg_conf)
+      os.rmdir(os.path.dirname(g_desktop.xorg_conf))
 
   g_desktop = None
   ParentProcessLogger.release_parent_if_connected(False)