summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-19 21:55:45 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-19 21:55:45 +0000
commit997b15372cc86f283efc0e9315bdf78224ef49d1 (patch)
tree95b7dc38cdda16ab7659933979b083afbe81eded /chrome/browser
parent4601d067d0a3f42f29fb6ca71d3099c90923e859 (diff)
downloadchromium_src-997b15372cc86f283efc0e9315bdf78224ef49d1.zip
chromium_src-997b15372cc86f283efc0e9315bdf78224ef49d1.tar.gz
chromium_src-997b15372cc86f283efc0e9315bdf78224ef49d1.tar.bz2
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
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/gtk/status_bubble_gtk.cc15
1 files changed, 11 insertions, 4 deletions
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);
}
+