Commit e5dd1eeb authored by Mitsuru Oshima's avatar Mitsuru Oshima Committed by Commit Bot

Take the frame height into account when placing candidate window when necessary.

ui/views dependency will be addressed as a part of
crbug.com/890403

Bug: b/116028711
Test: Tested using following apps with and without chrome caption, in
windowed, maximized, fullscreen using Japanese IME.

hangout, hangout inline reply (in notification),
Google play, FB chatheads

I couldn't test with Docs due to b/116855183

Change-Id: Ie371f44286ca0e42e6f0a7f4bb40c9e19e2717da
Reviewed-on: https://chromium-review.googlesource.com/1252012Reviewed-by: default avatarElijah Taylor <elijahtaylor@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarYuichiro Hanada <yhanada@chromium.org>
Commit-Queue: Mitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595756}
parent 394a0625
......@@ -5,4 +5,6 @@ include_rules = [
"+ui/events",
"+ui/gfx/geometry",
"+ui/keyboard",
# Revisit this dependency when crbug.com/890403 is resovled.
"+ui/views",
]
......@@ -24,6 +24,8 @@
#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/gfx/range/range.h"
#include "ui/keyboard/keyboard_controller.h"
#include "ui/views/widget/widget.h"
#include "ui/views/window/non_client_view.h"
namespace arc {
......@@ -526,6 +528,20 @@ bool ArcImeService::UpdateCursorRect(const gfx::Rect& rect,
converted.Offset(focused_arc_window_->GetToplevelWindow()
->GetBoundsInScreen()
.OffsetFromOrigin());
} else if (focused_arc_window_) {
auto* window = focused_arc_window_->GetToplevelWindow();
auto* widget = views::Widget::GetWidgetForNativeWindow(window);
// Check fullscreen window as well because it's possible for ARC to request
// frame regardless of window state.
bool covers_display =
widget && (widget->IsMaximized() || widget->IsFullscreen());
if (covers_display) {
auto* frame_view = widget->non_client_view()->frame_view();
// The frame height will be subtracted from client bounds.
gfx::Rect bounds =
frame_view->GetWindowBoundsForClientBounds(gfx::Rect());
converted.Offset(0, -bounds.y());
}
}
if (cursor_rect_ == converted)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment