]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Unity/X11: Bring back Unity capability registrations.
authorVMware, Inc <>
Tue, 28 Jun 2011 19:56:11 +0000 (12:56 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Tue, 28 Jun 2011 19:56:11 +0000 (12:56 -0700)
Dev's shift of plugin registration from UnityPlatformRegisterCaps to
C++ wrappers didn't account for *nix guests.  :P

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/services/plugins/unity/unityPluginPosix.cpp
open-vm-tools/services/plugins/unity/unityPluginPosix.h
open-vm-tools/services/plugins/unity/unitylib/unityPlatformX11.cc

index 61a689ec921288546c8671a8ce5345aced9724c4..77b703453ccb277ea2b095bd5ee90817d9d38174 100644 (file)
@@ -85,6 +85,38 @@ UnityPluginPosix::~UnityPluginPosix()
 }
 
 
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * UnityPluginPosix::GetCapabilities --
+ *
+ *      Called by the service core when the host requests the capabilities
+ *      supported by the guest tools.
+ *
+ * Results:
+ *      A list of capabilities to be sent to the host.
+ *
+ * Side effects:
+ *      None.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+std::vector<ToolsAppCapability>
+UnityPluginPosix::GetCapabilities(gboolean set) // IN
+{
+   std::vector<ToolsAppCapability> caps = UnityPlugin::GetCapabilities(set);
+#define ADDCAP(capName) caps.push_back(ToolsAppCapabilityNewEntry(capName, set))
+   ADDCAP(UNITY_CAP_WORK_AREA);
+   ADDCAP(UNITY_CAP_START_MENU);
+   ADDCAP(UNITY_CAP_MULTI_MON);
+   ADDCAP(UNITY_CAP_VIRTUAL_DESK);
+   ADDCAP(UNITY_CAP_STICKY_WINDOWS);
+#undef ADDCAP
+   return caps;
+}
+
+
 /*
  *-----------------------------------------------------------------------------
  *
index 46acd2876444f2096c9fdb3fcd0552ca6dea5d77..244be4d2bee572bf3e90654dfbc9235baf356505 100644 (file)
@@ -44,6 +44,7 @@ public:
    UnityPluginPosix(const ToolsAppCtx* ctx);
    virtual ~UnityPluginPosix();
 
+   std::vector<ToolsAppCapability> GetCapabilities(gboolean set);
    std::vector<ToolsPluginSignalCb> GetSignalRegistrations(ToolsPluginData*) const;
 
 private:
index 992a2bb1433a8ec0da0adf81f86808b25416d139..3b50897cdc9bbce39e05dbc3862ab8b980b38947 100644 (file)
@@ -91,14 +91,6 @@ static Bool SetWindowStickiness(UnityPlatform *up,
                                 Bool wantSticky);
 static UnitySpecialWindow *MakeCompositeOverlaysObject(UnityPlatform *up);
 
-static const GuestCapabilities platformUnityCaps[] = {
-   UNITY_CAP_WORK_AREA,
-   UNITY_CAP_START_MENU,
-   UNITY_CAP_MULTI_MON,
-   UNITY_CAP_VIRTUAL_DESK,
-   UNITY_CAP_STICKY_WINDOWS,
-};
-
 /*
  * Has to be global for UnityPlatformXErrorHandler
  */
@@ -362,70 +354,6 @@ UnityPlatformCleanup(UnityPlatform *up) // IN
 }
 
 
-/*
- *----------------------------------------------------------------------------
- *
- * UnityPlatformRegisterCaps --
- *
- *      Register guest platform specific capabilities with the VMX.
- *
- * Results:
- *      None.
- *
- * Side effects:
- *      None.
- *
- *----------------------------------------------------------------------------
- */
-
-void
-UnityPlatformRegisterCaps(UnityPlatform *up) // IN
-{
-   ASSERT(up);
-
-   if (!RpcOut_sendOne(NULL, NULL, UNITY_RPC_SHOW_TASKBAR_CAP " %d",
-                       Unity_IsSupported() ? 1 : 0)) {
-      Debug("Could not set unity show taskbar cap\n");
-   }
-
-   AppUtil_SendGuestCaps(platformUnityCaps, ARRAYSIZE(platformUnityCaps), TRUE);
-}
-
-
-/*
- *----------------------------------------------------------------------------
- *
- * UnityPlatformUnregisterCaps --
- *
- *      Unregister guest platform specific capabilities with the VMX.
- *
- * Results:
- *      None.
- *
- * Side effects:
- *      None.
- *
- *----------------------------------------------------------------------------
- */
-
-void
-UnityPlatformUnregisterCaps(UnityPlatform *up) // IN
-{
-   /*
-    * This function may potentially be called during UnityPlatform destruction.
-    */
-   if (!up) {
-      return;
-   }
-
-   AppUtil_SendGuestCaps(platformUnityCaps, ARRAYSIZE(platformUnityCaps), FALSE);
-
-   if (!RpcOut_sendOne(NULL, NULL, UNITY_RPC_SHOW_TASKBAR_CAP " 0")) {
-      Debug("Failed to unregister Unity taskbar capability\n");
-   }
-}
-
-
 /*****************************************************************************
  * Unity main loop and event handling                                        *
  *****************************************************************************/