]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Unity/X11: Disable Unity when running under vmwgfx.
authorVMware, Inc <>
Mon, 22 Mar 2010 19:09:52 +0000 (12:09 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Mon, 22 Mar 2010 19:09:52 +0000 (12:09 -0700)
From bug 527219:
"Unity/X11 and the new (and experimental) vmwgfx driver don't yet play nicely
together. We don't expect this to be ironed out anytime soon, so for Cobalt &
Cheerios we'll instead disable Unity/X11 unless vmware-user knows it's running
with the legacy vmware_drv.so X11 video driver."

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/unity/unityPlatformX11.c

index 9c5cf012baaf8f59e738cfcd57da6ad33e5da64f..3dd4f59fa1416392bea70a32dd24fad3a2d879a0 100644 (file)
@@ -116,6 +116,27 @@ static int unityX11ErrorCount = 0;
 Bool
 UnityPlatformIsSupported(void)
 {
+   Display *dpy;
+   int major;
+   int event_base;
+   int error_base;
+
+   dpy = GDK_DISPLAY();
+   /*
+    * Unity/X11 doesn't yet work with the new vmwgfx driver.  Until that is
+    * fixed, we have to disable the feature.
+    *
+    * As for detecting which driver is in use, the legacy driver provides the
+    * VMWARE_CTRL extension for resolution and topology operations, while the
+    * new driver is instead controlled via XRandR.  If we don't find said
+    * extension, then we'll assume the new driver is in use and disable Unity.
+    */
+   if (XQueryExtension(dpy, "VMWARE_CTRL", &major, &event_base, &error_base) ==
+       False) {
+      Debug("Unity is not yet supported under the vmwgfx driver.\n");
+      return FALSE;
+   }
+
    return TRUE;
 }