diff options
author | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-07 04:06:02 +0000 |
---|---|---|
committer | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-07 04:06:02 +0000 |
commit | b57a28bcc8a8860182dd1de7869aed05c0aa04c0 (patch) | |
tree | 8038f03799837d45e4f6815df675c6bdb3f420ff /chrome/browser/gtk/toolbar_star_toggle_gtk.cc | |
parent | 76fd19a719f0af671e04fded9ab445fdb8e33fa0 (diff) | |
download | chromium_src-b57a28bcc8a8860182dd1de7869aed05c0aa04c0.zip chromium_src-b57a28bcc8a8860182dd1de7869aed05c0aa04c0.tar.gz chromium_src-b57a28bcc8a8860182dd1de7869aed05c0aa04c0.tar.bz2 |
Linux: Improve info bubble placement.
Make InfoBubble's constructor take positions relative to the browser
window's origin, rather than the absolute positions used by Views.
Otherwise, we run into issues when the browser window is being moved while
the bubble is created -- this is unlikely to happen for bookmark bubbles,
but when the first run bubble is created, the browser window may or may not
be in the final place that the window manager is going to put it. There
was previously a 200 ms delay before opening the bubble, but that approach
still fails sometimes when X is being forwarded over a network connection.
This change makes us update the bubble's position as we receive
ConfigureNotify events about its browser window.
TEST=checked that first-run and bookmark bubbles are placed correctly in openbox, KDE, metacity, fluxbox, and ion3
Review URL: http://codereview.chromium.org/256068
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28232 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/toolbar_star_toggle_gtk.cc')
-rw-r--r-- | chrome/browser/gtk/toolbar_star_toggle_gtk.cc | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/chrome/browser/gtk/toolbar_star_toggle_gtk.cc b/chrome/browser/gtk/toolbar_star_toggle_gtk.cc index c122a9e..a634618 100644 --- a/chrome/browser/gtk/toolbar_star_toggle_gtk.cc +++ b/chrome/browser/gtk/toolbar_star_toggle_gtk.cc @@ -66,15 +66,8 @@ void ToolbarStarToggleGtk::Observe(NotificationType type, void ToolbarStarToggleGtk::ShowStarBubble(const GURL& url, bool newly_bookmarked) { GtkWidget* widget = widget_.get(); - gint x, y; - gdk_window_get_origin(widget->window, &x, &y); - x += widget->allocation.x; - y += widget->allocation.y; - gint width = widget->allocation.width; - gint height = widget->allocation.height; - BookmarkBubbleGtk::Show(GTK_WINDOW(gtk_widget_get_toplevel(widget)), - gfx::Rect(x, y, width, height), + gfx::Rect(widget->allocation), host_->profile(), url, newly_bookmarked); |