From 997b15372cc86f283efc0e9315bdf78224ef49d1 Mon Sep 17 00:00:00 2001 From: "evan@chromium.org" Date: Thu, 19 Feb 2009 21:55:45 +0000 Subject: Fix status bubble positioning on non-tiled window managers. gtk_window_get_position includes the window decoration, so it was the wrong function to use. Also, switch to using the requisition rather than getting the top-level size, as that is what we use elsewhere. Review URL: http://codereview.chromium.org/21515 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10040 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/gtk/status_bubble_gtk.cc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'chrome/browser') diff --git a/chrome/browser/gtk/status_bubble_gtk.cc b/chrome/browser/gtk/status_bubble_gtk.cc index 4e67bee..dc4ca24 100644 --- a/chrome/browser/gtk/status_bubble_gtk.cc +++ b/chrome/browser/gtk/status_bubble_gtk.cc @@ -7,6 +7,10 @@ #include "base/string_util.h" #include "googleurl/src/gurl.h" +// NOTE: this code is probably the wrong approach for the status bubble. +// Talk to evanm before you attempt to fix bugs in it -- we're probably +// better off restructuring it. + StatusBubbleGtk::StatusBubbleGtk(GtkWindow* parent) : parent_(parent), window_(NULL) { } @@ -64,10 +68,13 @@ void StatusBubbleGtk::Create() { } void StatusBubbleGtk::Reposition() { - int x, y, width, height, parent_height; - gtk_window_get_position(parent_, &x, &y); + int x, y, width, parent_height; + gdk_window_get_position(GTK_WIDGET(parent_)->window, &x, &y); gtk_window_get_size(parent_, &width, &parent_height); - gtk_window_get_size(GTK_WINDOW(window_), &width, &height); + GtkRequisition requisition; + gtk_widget_size_request(window_, &requisition); // TODO(port): RTL positioning. - gtk_window_move(GTK_WINDOW(window_), x, y + parent_height - height); + gtk_window_move(GTK_WINDOW(window_), x, + y + parent_height - requisition.height); } + -- cgit v1.1