summaryrefslogtreecommitdiffstats
path: root/chrome/browser/window_sizer_linux.cc
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-27 02:59:36 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-27 02:59:36 +0000
commitdbcd136f5ca76e7056ffe3c7b3a0f2d1d531076c (patch)
tree30952d4ef9df614e200a395b15190d6881eb1e3f /chrome/browser/window_sizer_linux.cc
parent2385216237b2db00863afd386e1ad40e1eff670f (diff)
downloadchromium_src-dbcd136f5ca76e7056ffe3c7b3a0f2d1d531076c.zip
chromium_src-dbcd136f5ca76e7056ffe3c7b3a0f2d1d531076c.tar.gz
chromium_src-dbcd136f5ca76e7056ffe3c7b3a0f2d1d531076c.tar.bz2
Fix comparison in window_sizer_linux. There can be multiple desktops so data_len can be greater.
TBR=evan BUG=none TEST=should work on window managers that support the wm-spec. Review URL: http://codereview.chromium.org/113884 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16970 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/window_sizer_linux.cc')
-rw-r--r--chrome/browser/window_sizer_linux.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/chrome/browser/window_sizer_linux.cc b/chrome/browser/window_sizer_linux.cc
index 4cee190..fc5fc0d 100644
--- a/chrome/browser/window_sizer_linux.cc
+++ b/chrome/browser/window_sizer_linux.cc
@@ -58,6 +58,7 @@ class DefaultMonitorInfoProvider : public WindowSizer::MonitorInfoProvider {
// Get the available screen space as a gfx::Rect, or return false if
// if it's unavailable (i.e. the window manager doesn't support
// retrieving this).
+ // TODO(thestig) Use _NET_CURRENT_DESKTOP here as well?
bool GetScreenWorkArea(gfx::Rect* out_rect) const {
gboolean ok;
guchar* raw_data = NULL;
@@ -76,7 +77,7 @@ class DefaultMonitorInfoProvider : public WindowSizer::MonitorInfoProvider {
return false;
// We expect to get four longs back: x1, y1, x2, y2.
- if (data_len != 4 * sizeof(glong)) {
+ if (data_len < static_cast<gint>(4 * sizeof(glong))) {
NOTREACHED();
g_free(raw_data);
return false;