diff options
author | suzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-15 08:20:19 +0000 |
---|---|---|
committer | suzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-15 08:20:19 +0000 |
commit | aeba67b45fc66b5c03205a470cb87d3995ab198a (patch) | |
tree | 84dcd8a86108ddd2b0c18e40795dfbea1b32dc7d /chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc | |
parent | f35334961b26e1382810780a99761c8fc1086d5f (diff) | |
download | chromium_src-aeba67b45fc66b5c03205a470cb87d3995ab198a.zip chromium_src-aeba67b45fc66b5c03205a470cb87d3995ab198a.tar.gz chromium_src-aeba67b45fc66b5c03205a470cb87d3995ab198a.tar.bz2 |
Linux: Stack autocomplete popup window directly on top of the browser's toplevel window.
BUG=19082 "Linux: Omnibox auto-complete popup is on top of IME candidate window when using SCIM"
TEST=Please refer to the bug report for how to test.
Review URL: http://codereview.chromium.org/274046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29102 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc')
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc index 78d8708..06e7c1a 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc +++ b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc @@ -18,13 +18,14 @@ #include "base/string_util.h" #include "chrome/browser/autocomplete/autocomplete.h" #include "chrome/browser/autocomplete/autocomplete_edit.h" -#include "chrome/browser/autocomplete/autocomplete_edit_view.h" +#include "chrome/browser/autocomplete/autocomplete_edit_view_gtk.h" #include "chrome/browser/autocomplete/autocomplete_popup_model.h" #include "chrome/browser/bubble_positioner.h" #include "chrome/browser/defaults.h" #include "chrome/browser/profile.h" #include "chrome/browser/search_engines/template_url.h" #include "chrome/browser/search_engines/template_url_model.h" +#include "chrome/common/gtk_util.h" #include "chrome/common/notification_service.h" #include "grit/theme_resources.h" @@ -345,6 +346,7 @@ void AutocompletePopupViewGtk::Show(size_t num_results) { gtk_window_move(GTK_WINDOW(window_), rect.x(), rect.y()); gtk_widget_set_size_request(window_, rect.width(), rect.height()); gtk_widget_show(window_); + StackWindow(); opened_ = true; } @@ -353,6 +355,14 @@ void AutocompletePopupViewGtk::Hide() { opened_ = false; } +void AutocompletePopupViewGtk::StackWindow() { + gfx::NativeView edit_view = edit_view_->GetNativeView(); + DCHECK(GTK_IS_WIDGET(edit_view)); + GtkWidget* toplevel = gtk_widget_get_toplevel(edit_view); + DCHECK(GTK_WIDGET_TOPLEVEL(toplevel)); + gtk_util::StackPopupWindow(window_, toplevel); +} + size_t AutocompletePopupViewGtk::LineFromY(int y) { size_t line = std::max(y - kBorderThickness, 0) / kHeightPerResult; return std::min(line, model_->result().size() - 1); |