diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-09 20:29:43 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-09 20:29:43 +0000 |
commit | 67723e657a2c6ae6ec0e59fae26df76a1d8ef277 (patch) | |
tree | b243b25ba678e0fbab08d944bee23c3a814b5c4d /chrome | |
parent | d9d6e94a3864b89e130336fc199d623e6e128136 (diff) | |
download | chromium_src-67723e657a2c6ae6ec0e59fae26df76a1d8ef277.zip chromium_src-67723e657a2c6ae6ec0e59fae26df76a1d8ef277.tar.gz chromium_src-67723e657a2c6ae6ec0e59fae26df76a1d8ef277.tar.bz2 |
Fix the Linux tab strip zone calculation when using the skyline. We are looking for the top-left origin of the tab strip in screen coordinates, but we sent in the coordinates of this point relative to the entire window to gtk_util::ConvertWidgetPointToScreen.
BUG=15867
TEST=Open enough tabs so that they must be resized. Repeatedly press the mouse over a close button so that many tabs are closed. The tabs should not resize until the mouse leaves the tab strip.
Review URL: http://codereview.chromium.org/155308
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20306 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rwxr-xr-x | chrome/browser/gtk/tabs/tab_strip_gtk.cc | 5 | ||||
-rw-r--r-- | chrome/common/gtk_util.h | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/gtk/tabs/tab_strip_gtk.cc index ab88546..b6b71d9 100755 --- a/chrome/browser/gtk/tabs/tab_strip_gtk.cc +++ b/chrome/browser/gtk/tabs/tab_strip_gtk.cc @@ -1098,9 +1098,10 @@ void TabStripGtk::ResizeLayoutTabs() { } bool TabStripGtk::IsCursorInTabStripZone() const { - gfx::Rect bds = bounds(); - gfx::Point tabstrip_topleft(bds.origin()); + gfx::Point tabstrip_topleft; gtk_util::ConvertWidgetPointToScreen(tabstrip_.get(), &tabstrip_topleft); + + gfx::Rect bds = bounds(); bds.set_origin(tabstrip_topleft); bds.set_height(bds.height() + kTabStripAnimationVSlop); diff --git a/chrome/common/gtk_util.h b/chrome/common/gtk_util.h index 58339d4..983cf4a 100644 --- a/chrome/common/gtk_util.h +++ b/chrome/common/gtk_util.h @@ -74,7 +74,8 @@ gfx::Point GetWidgetScreenPosition(GtkWidget* widget); // Returns the bounds of the specified widget in screen coordinates. gfx::Rect GetWidgetScreenBounds(GtkWidget* widget); -// Converts a point in a widget to screen coordinates. +// Converts a point in a widget to screen coordinates. The point |p| is +// relative to the widget's top-left origin. void ConvertWidgetPointToScreen(GtkWidget* widget, gfx::Point* p); // Initialize some GTK settings so that our dialogs are consistent. |