Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3952)

Unified Diff: chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc

Issue 159436: gtk: Use the requested window bounds when determining the location of the sou... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/gtk/tabs/tab_renderer_gtk.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc
===================================================================
--- chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc (revision 21634)
+++ chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc (working copy)
@@ -828,17 +828,17 @@
// A hidden widget moved with gtk_fixed_move in a GtkFixed container doesn't
// update its allocation until after the widget is shown, so we have to use
// the tab bounds we keep track of.
- int x, y;
- x = tab->bounds().x();
- y = tab->bounds().y();
-
+ //
+ // We use the requested bounds instead of the allocation because the
+ // allocation is relative to the first windowed widget ancestor of the tab.
+ // Because of this, we can't use the tabs allocation to get the screen bounds.
+ gfx::Rect bounds = tab->GetRequisition();
GtkWidget* widget = tab->widget();
GtkWidget* parent = gtk_widget_get_parent(widget);
gfx::Point point = gtk_util::GetWidgetScreenPosition(parent);
- x += point.x();
- y += point.y();
+ bounds.Offset(point);
- return gfx::Rect(x, y, widget->allocation.width, widget->allocation.height);
+ return gfx::Rect(bounds.x(), bounds.y(), bounds.width(), bounds.height());
}
void DraggedTabControllerGtk::HideFrame() {
« no previous file with comments | « no previous file | chrome/browser/gtk/tabs/tab_renderer_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698