Commit b54cf398 authored by wez's avatar wez Committed by Commit bot

Fix large cursors not to trigger MouseLock

BUG=429322

Review URL: https://codereview.chromium.org/693893005

Cr-Commit-Position: refs/heads/master@{#302493}
parent 3598d35d
...@@ -629,7 +629,7 @@ void ChromotingInstance::SetCursorShape( ...@@ -629,7 +629,7 @@ void ChromotingInstance::SetCursorShape(
dictionary.Set(pp::Var("hotspotY"), cursor_hotspot.y()); dictionary.Set(pp::Var("hotspotY"), cursor_hotspot.y());
dictionary.Set(pp::Var("data"), array_buffer); dictionary.Set(pp::Var("data"), array_buffer);
PostChromotingMessage("setCursorShape", dictionary); PostChromotingMessage("setCursorShape", dictionary);
input_handler_.SetMouseCursor(nullptr, cursor_hotspot); input_handler_.HideMouseCursor();
} else { } else {
if (delegate_large_cursors_) { if (delegate_large_cursors_) {
pp::VarDictionary dictionary; pp::VarDictionary dictionary;
......
...@@ -218,6 +218,11 @@ void PepperInputHandler::SetMouseCursor(scoped_ptr<pp::ImageData> image, ...@@ -218,6 +218,11 @@ void PepperInputHandler::SetMouseCursor(scoped_ptr<pp::ImageData> image,
} }
} }
void PepperInputHandler::HideMouseCursor() {
cursor_image_.reset();
pp::MouseCursor::SetCursor(instance_, PP_MOUSECURSOR_TYPE_NONE);
}
void PepperInputHandler::MouseLockLost() { void PepperInputHandler::MouseLockLost() {
DCHECK(mouse_lock_state_ == MouseLockOn || DCHECK(mouse_lock_state_ == MouseLockOn ||
mouse_lock_state_ == MouseLockCancelling); mouse_lock_state_ == MouseLockCancelling);
......
...@@ -43,11 +43,15 @@ class PepperInputHandler : public pp::MouseLock { ...@@ -43,11 +43,15 @@ class PepperInputHandler : public pp::MouseLock {
// Called when the plugin receives or loses focus. // Called when the plugin receives or loses focus.
void DidChangeFocus(bool has_focus); void DidChangeFocus(bool has_focus);
// Sets the mouse cursor image. Passing NULL image will lock the mouse if // Sets the mouse cursor image. Passing NULL |image| will cause the cursor to
// mouse lock is enabled. // be hidden.
// Passing NULL |image| will also cause mouse-lock to be entered, if allowed.
void SetMouseCursor(scoped_ptr<pp::ImageData> image, void SetMouseCursor(scoped_ptr<pp::ImageData> image,
const pp::Point& hotspot); const pp::Point& hotspot);
// Hides the mousr cursor without triggering mouse-lock.
void HideMouseCursor();
// Enable or disable sending mouse input when the plugin does not have input // Enable or disable sending mouse input when the plugin does not have input
// focus. // focus.
void set_send_mouse_input_when_unfocused(bool send) { void set_send_mouse_input_when_unfocused(bool send) {
......
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