From: VMware, Inc <> Date: Tue, 28 Jun 2011 19:56:11 +0000 (-0700) Subject: Unity/X11: Bring back Unity capability registrations. X-Git-Tag: 2011.06.27-437995~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6914930714c07f10e4c31a554f26abbfdcc5706e;p=thirdparty%2Fopen-vm-tools.git Unity/X11: Bring back Unity capability registrations. Dev's shift of plugin registration from UnityPlatformRegisterCaps to C++ wrappers didn't account for *nix guests. :P Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/services/plugins/unity/unityPluginPosix.cpp b/open-vm-tools/services/plugins/unity/unityPluginPosix.cpp index 61a689ec9..77b703453 100644 --- a/open-vm-tools/services/plugins/unity/unityPluginPosix.cpp +++ b/open-vm-tools/services/plugins/unity/unityPluginPosix.cpp @@ -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 +UnityPluginPosix::GetCapabilities(gboolean set) // IN +{ + std::vector 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; +} + + /* *----------------------------------------------------------------------------- * diff --git a/open-vm-tools/services/plugins/unity/unityPluginPosix.h b/open-vm-tools/services/plugins/unity/unityPluginPosix.h index 46acd2876..244be4d2b 100644 --- a/open-vm-tools/services/plugins/unity/unityPluginPosix.h +++ b/open-vm-tools/services/plugins/unity/unityPluginPosix.h @@ -44,6 +44,7 @@ public: UnityPluginPosix(const ToolsAppCtx* ctx); virtual ~UnityPluginPosix(); + std::vector GetCapabilities(gboolean set); std::vector GetSignalRegistrations(ToolsPluginData*) const; private: diff --git a/open-vm-tools/services/plugins/unity/unitylib/unityPlatformX11.cc b/open-vm-tools/services/plugins/unity/unitylib/unityPlatformX11.cc index 992a2bb14..3b50897cd 100644 --- a/open-vm-tools/services/plugins/unity/unitylib/unityPlatformX11.cc +++ b/open-vm-tools/services/plugins/unity/unitylib/unityPlatformX11.cc @@ -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 * *****************************************************************************/