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

Side by Side Diff: ui/base/ime/input_method_ibus.cc

Issue 10534134: Fix candidate window position issue. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix braces 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 unified diff | Download patch
« no previous file with comments | « ui/base/ime/ibus_client_impl.cc ('k') | ui/base/ime/mock_ibus_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/base/ime/input_method_ibus.h" 5 #include "ui/base/ime/input_method_ibus.h"
6 6
7 #include <glib.h> 7 #include <glib.h>
8 #include <glib-object.h> 8 #include <glib-object.h>
9 #include <X11/X.h> 9 #include <X11/X.h>
10 #include <X11/Xlib.h> 10 #include <X11/Xlib.h>
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 } 327 }
328 328
329 void InputMethodIBus::OnCaretBoundsChanged(const TextInputClient* client) { 329 void InputMethodIBus::OnCaretBoundsChanged(const TextInputClient* client) {
330 if (!context_focused_ || !IsTextInputClientFocused(client)) 330 if (!context_focused_ || !IsTextInputClientFocused(client))
331 return; 331 return;
332 332
333 // The current text input type should not be NONE if |context_| is focused. 333 // The current text input type should not be NONE if |context_| is focused.
334 DCHECK(!IsTextInputTypeNone()); 334 DCHECK(!IsTextInputTypeNone());
335 const gfx::Rect rect = GetTextInputClient()->GetCaretBounds(); 335 const gfx::Rect rect = GetTextInputClient()->GetCaretBounds();
336 336
337 gfx::Rect composition_head;
338 if (!GetTextInputClient()->GetCompositionCharacterBounds(0,
339 &composition_head)) {
340 composition_head = gfx::Rect();
341 }
342
337 // This function runs asynchronously. 343 // This function runs asynchronously.
338 ibus_client_->SetCursorLocation( 344 ibus_client_->SetCursorLocation(context_, rect, composition_head);
339 context_, rect.x(), rect.y(), rect.width(), rect.height());
340 } 345 }
341 346
342 void InputMethodIBus::CancelComposition(const TextInputClient* client) { 347 void InputMethodIBus::CancelComposition(const TextInputClient* client) {
343 if (context_focused_ && IsTextInputClientFocused(client)) 348 if (context_focused_ && IsTextInputClientFocused(client))
344 ResetContext(); 349 ResetContext();
345 } 350 }
346 351
347 std::string InputMethodIBus::GetInputLocale() { 352 std::string InputMethodIBus::GetInputLocale() {
348 // Not supported. 353 // Not supported.
349 return ""; 354 return "";
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 static IBusBus* ibus = NULL; 861 static IBusBus* ibus = NULL;
857 862
858 if (!ibus) { 863 if (!ibus) {
859 ibus = ibus_client_->GetConnection(); 864 ibus = ibus_client_->GetConnection();
860 DCHECK(ibus); 865 DCHECK(ibus);
861 } 866 }
862 return ibus; 867 return ibus;
863 } 868 }
864 869
865 } // namespace ui 870 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/ime/ibus_client_impl.cc ('k') | ui/base/ime/mock_ibus_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698