]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Unity/X11: Initialize fakeEvent before passing off for processing.
authorVMware, Inc <>
Thu, 18 Nov 2010 21:29:15 +0000 (13:29 -0800)
committerMarcelo Vanzin <mvanzin@vmware.com>
Thu, 18 Nov 2010 21:29:15 +0000 (13:29 -0800)
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 <mvanzin@vmware.com>
open-vm-tools/services/plugins/unity/unitylib/unityPlatformX11Window.c

index 974b0f4f3ea78004ebaedce2a9ea9a6860fda51a..9bd30c9a34ae11bde40ddfcde4de44cf59162e45 100644 (file)
@@ -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);
       }