diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-29 18:46:25 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-29 18:46:25 +0000 |
commit | ecc4ce517d732b9393b3ff21a20a5f2664b60976 (patch) | |
tree | 5616d3c0a8a9348c4f2e0f31ae5235c100d9f2d2 /chrome | |
parent | a294983155dd491fd5db7c133d186afd1a05c9ef (diff) | |
download | chromium_src-ecc4ce517d732b9393b3ff21a20a5f2664b60976.zip chromium_src-ecc4ce517d732b9393b3ff21a20a5f2664b60976.tar.gz chromium_src-ecc4ce517d732b9393b3ff21a20a5f2664b60976.tar.bz2 |
Fix a bug where all clicks in app mode windows would result in a window move.
Also update the comment to properly describe the code. It was referring to the tab strip, but the code was using the toolbar.
BUG=15576
Review URL: http://codereview.chromium.org/150037
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19511 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc index 9e362df..2e30b72 100644 --- a/chrome/browser/gtk/browser_window_gtk.cc +++ b/chrome/browser/gtk/browser_window_gtk.cc @@ -1190,10 +1190,16 @@ gboolean BrowserWindowGtk::OnButtonPressEvent(GtkWidget* widget, GdkWindowEdge edge; bool has_hit_edge = browser->GetWindowEdge(static_cast<int>(event->x), static_cast<int>(event->y), &edge); - // Ignore clicks that are in/below the tab strip. - gint tabstrip_y; - gtk_widget_get_pointer(browser->toolbar_->widget(), NULL, &tabstrip_y); - bool has_hit_titlebar = !browser->IsFullscreen() && (tabstrip_y < 0) + // Ignore clicks that are in/below the browser toolbar. + GtkWidget* toolbar = browser->toolbar_->widget(); + if (!GTK_WIDGET_VISIBLE(toolbar)) { + // If the toolbar is not showing, use the location of web contents as the + // boundary of where to ignore clicks. + toolbar = browser->render_area_vbox_; + } + gint toolbar_y; + gtk_widget_get_pointer(toolbar, NULL, &toolbar_y); + bool has_hit_titlebar = !browser->IsFullscreen() && (toolbar_y < 0) && !has_hit_edge; if (event->button == 1) { if (GDK_BUTTON_PRESS == event->type) { |