Index: chrome/browser/chromeos/input_method/candidate_window.cc |
diff --git a/chrome/browser/chromeos/input_method/candidate_window.cc b/chrome/browser/chromeos/input_method/candidate_window.cc |
index 030dc0c6b3b84017e383fce067fa65847159c8c7..86f2472355d28982829ced9fa974217205678a81 100644 |
--- a/chrome/browser/chromeos/input_method/candidate_window.cc |
+++ b/chrome/browser/chromeos/input_method/candidate_window.cc |
@@ -776,6 +776,7 @@ CandidateWindowView::CandidateWindowView(views::Widget* parent_frame) |
previous_candidate_column_size_(0, 0), |
previous_annotation_column_size_(0, 0), |
is_suggestion_window_location_available_(false), |
+ should_show_upper_side_(false), |
was_candidate_window_open_(false) { |
} |
@@ -889,6 +890,8 @@ void CandidateWindowView::UpdatePreeditText(const std::string& utf8_text) { |
} |
void CandidateWindowView::ShowLookupTable() { |
+ if (!candidate_area_->IsShown()) |
+ should_show_upper_side_ = false; |
candidate_area_->Show(); |
UpdateParentArea(); |
} |
@@ -1243,10 +1246,16 @@ void CandidateWindowView::ResizeAndMoveParentFrame() { |
// Handle overflow at the bottom. |
const int bottom_overflow = frame_bounds.bottom() - screen_bounds.bottom(); |
- if (bottom_overflow > 0) { |
+ |
+ // To avoid flickering window position, the candidate window should be shown |
+ // on upper side of composition string if it was shown there. |
+ if (should_show_upper_side_ || bottom_overflow > 0) { |
frame_bounds.set_y(frame_bounds.y() - height - frame_bounds.height()); |
+ should_show_upper_side_ = true; |
} |
+ // TODO(nona): check top_overflow here. |
+ |
// Move the window per the cursor location. |
// SetBounds() is not cheap. Only call this when it is really changed. |
if (frame_bounds != old_bounds) |