Commit a98ce1ce authored by Tetsui Ohkubo's avatar Tetsui Ohkubo Committed by Commit Bot

exo: UpdateCursor when focus surface changes

In exo::Pointer, SetCursorType provides system wide cursor shape change
while UpdateCursor updates the cursor per Widget. Because of that, by
followng the steps below, we can cause a glitch. In order to prevent
that, we should call UpdateCursor at the end of SetFocus.

1. Initially, the cursor is normal on both windows.
   Window #1: cursor kPointer(focused), Window #2: cursor kPointer
   Shown cursor: kPointer
2. ARC calls SetCursorType(kNone).
   Window #1: cursor kNone(focused), Window #2: cursor kPointer
   Shown cursor: kNone
3. Press Alt-Tab to focus Window #2. ARC calls SetCursorType(kPointer).
   Window #1: cursor kNone, Window #2: cursor kPointer (focused)
   Shown cursor: kPointer
4. Move the cursor to the location in Window #1. ARC thinks it should be
   kPointer, but SetCursorType is not called as it's already called.
   As a result, kNone is shown although kPointer should be shown.
   Window #1: cursor kNone, Window #2: cursor kPointer (focused)
   Shown cursor: kNone

TEST=manual(Follow the repro steps in #2 of the bug)
BUG=b:132095671

Change-Id: Iea860a0f2099b6b1d5d20dc8483ec1ae975792bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1885130Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711496}
parent 8526ab44
......@@ -601,6 +601,7 @@ void Pointer::SetFocus(Surface* surface,
focus_surface_->AddSurfaceObserver(this);
}
delegate_->OnPointerFrame();
UpdateCursor();
}
void Pointer::UpdatePointerSurface(Surface* surface) {
......
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