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

Unified Diff: ui/base/ime/input_method_auralinux.cc

Issue 2593323002: Use the physical-pixel space for native IME on linux platform. (Closed)
Patch Set: Created 4 years 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
Index: ui/base/ime/input_method_auralinux.cc
diff --git a/ui/base/ime/input_method_auralinux.cc b/ui/base/ime/input_method_auralinux.cc
index 31023c35e206dd62bb968d0474123bd8edfe6fb1..cc541f5964d14103c4c0ee2e40d60ed4b84725db 100644
--- a/ui/base/ime/input_method_auralinux.cc
+++ b/ui/base/ime/input_method_auralinux.cc
@@ -12,6 +12,7 @@
#include "ui/base/ime/linux/linux_input_method_context_factory.h"
#include "ui/base/ime/text_input_client.h"
#include "ui/events/event.h"
+#include "ui/gfx/geometry/rect.h"
namespace {
@@ -279,7 +280,9 @@ void InputMethodAuraLinux::OnCaretBoundsChanged(const TextInputClient* client) {
if (!IsTextInputClientFocused(client))
return;
NotifyTextInputCaretBoundsChanged(client);
- context_->SetCursorLocation(GetTextInputClient()->GetCaretBounds());
+ context_->SetCursorLocation(
+ gfx::ScaleToEnclosingRect(client->GetCaretBounds(),
+ client->GetScaleFactor()));
sadrul 2016/12/22 01:30:22 Can you update the doc [1] to mention that this is
Shu Chen 2016/12/22 03:02:27 I've leveraged [2] and removed the GetScaleFactor
if (!IsTextInputTypeNone() && text_input_type_ != TEXT_INPUT_TYPE_PASSWORD &&
GetEngine())

Powered by Google App Engine
This is Rietveld 408576698