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..95f18e35e027dd70a288f45cec8da8951ef2f504 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), |
+ did_window_avoid_display_edge_(false), |
Hiro Komatsu
2012/06/08 05:22:42
How about keep_position_ or should_keep_position_?
Seigo Nonaka
2012/06/08 05:42:14
position doesn't mean bit clear.
changed to |shoul
|
was_candidate_window_open_(false) { |
} |
@@ -889,6 +890,8 @@ void CandidateWindowView::UpdatePreeditText(const std::string& utf8_text) { |
} |
void CandidateWindowView::ShowLookupTable() { |
+ if (!candidate_area_->IsShown()) |
+ did_window_avoid_display_edge_ = false; |
candidate_area_->Show(); |
UpdateParentArea(); |
} |
@@ -1243,8 +1246,12 @@ void CandidateWindowView::ResizeAndMoveParentFrame() { |
// Handle overflow at the bottom. |
const int bottom_overflow = frame_bounds.bottom() - screen_bounds.bottom(); |
- if (bottom_overflow > 0) { |
+ |
+ // To avoid flicking window position, the candidate window should be shown on |
+ // upper side of composition string if it was shown there. |
+ if (did_window_avoid_display_edge_ || bottom_overflow > 0) { |
frame_bounds.set_y(frame_bounds.y() - height - frame_bounds.height()); |
+ did_window_avoid_display_edge_ = true; |
} |
// Move the window per the cursor location. |