Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1976)

Unified Diff: chrome/browser/chromeos/input_method/candidate_window.cc

Issue 10542051: Reduce candidate window flickering. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Leave todo comment. Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/input_method/candidate_window_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « no previous file | chrome/browser/chromeos/input_method/candidate_window_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698