summaryrefslogtreecommitdiffstats
path: root/chrome/browser/window_sizer_linux.cc
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-28 22:38:39 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-28 22:38:39 +0000
commit475dae86bdffadd6136bafe47f10963257e6987c (patch)
tree1bfd018b9a2498a8a0f7e90dcbd7fafe2afe99ee /chrome/browser/window_sizer_linux.cc
parent3ab4b677081dd666cfa1934bd0a1875319202d26 (diff)
downloadchromium_src-475dae86bdffadd6136bafe47f10963257e6987c.zip
chromium_src-475dae86bdffadd6136bafe47f10963257e6987c.tar.gz
chromium_src-475dae86bdffadd6136bafe47f10963257e6987c.tar.bz2
Fix how we calculate workarea size (_NET_WORKAREA gives width/height).
Fix how we calculate initial window size to be workarea - 20 for height and width. This matches Windows. BUG=23229 Review URL: http://codereview.chromium.org/254004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27425 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/window_sizer_linux.cc')
-rw-r--r--chrome/browser/window_sizer_linux.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/chrome/browser/window_sizer_linux.cc b/chrome/browser/window_sizer_linux.cc
index 1dea211..5be1e57 100644
--- a/chrome/browser/window_sizer_linux.cc
+++ b/chrome/browser/window_sizer_linux.cc
@@ -11,10 +11,11 @@
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_window.h"
-// How much horizontal and vertical offset there is between newly
-// opened windows. We don't care on Linux since the window manager generally
-// does a good job of window placement.
-const int WindowSizer::kWindowTilePixels = 0;
+// Used to pad the default new window size. On Windows, this is also used for
+// positioning new windows (each window is offset from the previous one).
+// Since we don't position windows, it's only used for the default new window
+// size.
+const int WindowSizer::kWindowTilePixels = 10;
// An implementation of WindowSizer::MonitorInfoProvider that gets the actual
// monitor information from X via GDK.
@@ -78,7 +79,7 @@ class DefaultMonitorInfoProvider : public WindowSizer::MonitorInfoProvider {
if (!ok)
return false;
- // We expect to get four longs back: x1, y1, x2, y2.
+ // We expect to get four longs back: x, y, width, height.
if (data_len < static_cast<gint>(4 * sizeof(glong))) {
NOTREACHED();
g_free(raw_data);
@@ -88,8 +89,8 @@ class DefaultMonitorInfoProvider : public WindowSizer::MonitorInfoProvider {
glong* data = reinterpret_cast<glong*>(raw_data);
gint x = data[0];
gint y = data[1];
- gint width = data[0] + data[2];
- gint height = data[1] + data[3];
+ gint width = data[2];
+ gint height = data[3];
g_free(raw_data);
out_rect->SetRect(x, y, width, height);