summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-11 20:27:33 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-11 20:27:33 +0000
commit9d29f2d54d2d388343d43c29a7d154055d57e58c (patch)
tree019675bbbb643d847a7f8c3eb8e0cd3173a9602d /chrome
parent0245eb5a649d28a927c1248b06ebb7874a9bd494 (diff)
downloadchromium_src-9d29f2d54d2d388343d43c29a7d154055d57e58c.zip
chromium_src-9d29f2d54d2d388343d43c29a7d154055d57e58c.tar.gz
chromium_src-9d29f2d54d2d388343d43c29a7d154055d57e58c.tar.bz2
Fixes bug in wm_ipc where we were passing ints to XChangeProperty when
we should have been passing longs. BUG=none TEST=none Review URL: http://codereview.chromium.org/879002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41315 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/chromeos/wm_ipc.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/chrome/browser/chromeos/wm_ipc.cc b/chrome/browser/chromeos/wm_ipc.cc
index d2c4260..99f71f5 100644
--- a/chrome/browser/chromeos/wm_ipc.cc
+++ b/chrome/browser/chromeos/wm_ipc.cc
@@ -45,6 +45,11 @@ static const AtomInfo kAtomInfos[] = {
bool SetIntProperty(XID xid, Atom xatom, const std::vector<int>& values) {
DCHECK(!values.empty());
+ // XChangeProperty expects values of type 32 to be longs.
+ scoped_array<long> data(new long[values.size()]);
+ for (size_t i = 0; i < values.size(); ++i)
+ data[i] = values[i];
+
// TODO: Trap errors and return false on failure.
XChangeProperty(x11_util::GetXDisplay(),
xid,
@@ -52,7 +57,7 @@ bool SetIntProperty(XID xid, Atom xatom, const std::vector<int>& values) {
xatom,
32, // size in bits of items in 'value'
PropModeReplace,
- reinterpret_cast<const unsigned char*>(&values.front()),
+ reinterpret_cast<const unsigned char*>(data.get()),
values.size()); // num items
XFlush(x11_util::GetXDisplay());
return true;