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

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: address comments 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))
Yusuke Sato 2012/06/13 15:17:38 {} is needed for a multi-line if.
Seigo Nonaka 2012/06/14 01:04:57 Done.
340 composition_head = gfx::Rect();
341
337 // This function runs asynchronously. 342 // This function runs asynchronously.
338 ibus_client_->SetCursorLocation( 343 ibus_client_->SetCursorLocation(context_, rect, composition_head);
339 context_, rect.x(), rect.y(), rect.width(), rect.height());
340 } 344 }
341 345
342 void InputMethodIBus::CancelComposition(const TextInputClient* client) { 346 void InputMethodIBus::CancelComposition(const TextInputClient* client) {
343 if (context_focused_ && IsTextInputClientFocused(client)) 347 if (context_focused_ && IsTextInputClientFocused(client))
344 ResetContext(); 348 ResetContext();
345 } 349 }
346 350
347 std::string InputMethodIBus::GetInputLocale() { 351 std::string InputMethodIBus::GetInputLocale() {
348 // Not supported. 352 // Not supported.
349 return ""; 353 return "";
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 static IBusBus* ibus = NULL; 860 static IBusBus* ibus = NULL;
857 861
858 if (!ibus) { 862 if (!ibus) {
859 ibus = ibus_client_->GetConnection(); 863 ibus = ibus_client_->GetConnection();
860 DCHECK(ibus); 864 DCHECK(ibus);
861 } 865 }
862 return ibus; 866 return ibus;
863 } 867 }
864 868
865 } // namespace ui 869 } // 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