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

Unified Diff: ui/keyboard/keyboard_layout_manager.cc

Issue 2546963002: Do not move the on-screen keyboard to another display after loading an IME. (Closed)
Patch Set: rebase 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
« no previous file with comments | « ui/keyboard/DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/keyboard/keyboard_layout_manager.cc
diff --git a/ui/keyboard/keyboard_layout_manager.cc b/ui/keyboard/keyboard_layout_manager.cc
index e29b9f0795db46669db7f927f9171152078da173..81428232c04da5ac267da1378cd81b281e5292d2 100644
--- a/ui/keyboard/keyboard_layout_manager.cc
+++ b/ui/keyboard/keyboard_layout_manager.cc
@@ -5,6 +5,8 @@
#include "ui/keyboard/keyboard_layout_manager.h"
#include "ui/compositor/layer_animator.h"
+#include "ui/display/display.h"
+#include "ui/display/screen.h"
#include "ui/keyboard/keyboard_controller.h"
#include "ui/keyboard/keyboard_util.h"
@@ -81,7 +83,16 @@ void KeyboardLayoutManager::SetChildBounds(aura::Window* child,
// The window height is set to 0 initially or before switch to an IME in a
// different extension. Virtual keyboard window may wait for this bounds
// change to correctly animate in.
- controller_->ShowKeyboard(controller_->keyboard_locked());
+ if (controller_->keyboard_locked()) {
+ // Do not move the keyboard to another display after loading an IME.
bshe 2016/12/14 16:18:28 nit: loading an IME/switch to an IME in a differen
yhanada 2016/12/15 01:10:20 Done.
+ const int64_t display_id =
+ display::Screen::GetScreen()
+ ->GetDisplayNearestWindow(controller_->GetContainerWindow())
+ .id();
+ controller_->ShowKeyboardInDisplay(display_id);
+ } else {
+ controller_->ShowKeyboard(false /* lock */);
+ }
} else {
if (controller_->keyboard_mode() == FULL_WIDTH) {
// We need to send out this notification only if keyboard is visible since
« no previous file with comments | « ui/keyboard/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698