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

Unified Diff: ash/display/display_controller.cc

Issue 902123002: Fix initial hiding and centering cursor on Ozone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months 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 | « no previous file | ash/display/mouse_cursor_event_filter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_controller.cc
diff --git a/ash/display/display_controller.cc b/ash/display/display_controller.cc
index 7a3b6f9959daef8f7b0067eec767a425a89924be..949177e0feffbed4124b26b7fb8d8a905d7c0795 100644
--- a/ash/display/display_controller.cc
+++ b/ash/display/display_controller.cc
@@ -30,6 +30,7 @@
#include "ui/aura/client/capture_client.h"
#include "ui/aura/client/focus_client.h"
#include "ui/aura/client/screen_position_client.h"
+#include "ui/aura/env.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_property.h"
@@ -537,6 +538,14 @@ void DisplayController::SetPrimaryDisplay(
}
void DisplayController::EnsurePointerInDisplays() {
+ if (!aura::Env::GetInstance()->mouse_moved() &&
pkotwicz 2015/02/06 16:12:44 I am unsure whether checking whether the mouse was
+ Shell::initially_hide_cursor()) {
+ // Do not move the cursor if the cursor has not yet been moved and the
+ // cursor is initially hidden. Moving the cursor generates a mouse event
+ // which shows the cursor.
+ return;
+ }
+
// If the mouse is currently on a display in native location,
// use the same native location. Otherwise find the display closest
// to the current cursor location in screen coordinates.
« no previous file with comments | « no previous file | ash/display/mouse_cursor_event_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698