From: VMware, Inc <> Date: Thu, 18 Nov 2010 21:29:15 +0000 (-0800) Subject: Unity/X11: Initialize fakeEvent before passing off for processing. X-Git-Tag: 2010.11.17-327185~68 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=18884d27ba3bb26fda1d1a55b003d5a73cbfd232;p=thirdparty%2Fopen-vm-tools.git Unity/X11: Initialize fakeEvent before passing off for processing. From bug 626112 update 8: "During init when querying all windows, Unity/X11 enumerates all windows' properties and passes the properties down to the property event handler via fake property events. Without initializing to 0, fakeEvent.xproperty.state may be set to "PropertyDelete", so code lower in the stack may mistakenly think that windows' initial properties are actually *removed* properties." Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/services/plugins/unity/unitylib/unityPlatformX11Window.c b/open-vm-tools/services/plugins/unity/unitylib/unityPlatformX11Window.c index 974b0f4f3..9bd30c9a3 100644 --- a/open-vm-tools/services/plugins/unity/unitylib/unityPlatformX11Window.c +++ b/open-vm-tools/services/plugins/unity/unitylib/unityPlatformX11Window.c @@ -3631,8 +3631,9 @@ UPWindowPushFullUpdate(UnityPlatform *up, // IN &propCount); if (!UnityPlatformGetErrorCount(up)) { for (i = 0; i < propCount; i++) { - XEvent fakeEvent; + XEvent fakeEvent = {0,}; + fakeEvent.xproperty.state = PropertyNewValue; fakeEvent.xproperty.atom = props[i]; UPWindowProcessPropertyEvent(up, upw, &fakeEvent); }