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

Unified Diff: ash/mus/bridge/shell_port_mash.cc

Issue 2957313003: Make ShellPortMash also dispatch to cursor_manager in mus mode. (Closed)
Patch Set: Check GetAshConfig() Created 3 years, 6 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/wm/native_cursor_manager_ash_mus.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/bridge/shell_port_mash.cc
diff --git a/ash/mus/bridge/shell_port_mash.cc b/ash/mus/bridge/shell_port_mash.cc
index 58fa0608d8f44d272a2c8c6b6b013bde0800a98e..9e932322e2facd5b0d8cd576dc6f1b60400fed1e 100644
--- a/ash/mus/bridge/shell_port_mash.cc
+++ b/ash/mus/bridge/shell_port_mash.cc
@@ -131,27 +131,47 @@ ShellPortMash::CreateTouchTransformDelegate() {
}
void ShellPortMash::LockCursor() {
- window_manager_->window_manager_client()->LockCursor();
+ // When we are running in mus, we need to keep track of state not just in the
+ // window server, but also locally in ash because ash treats the cursor
+ // manager as the canonical state for now. NativeCursorManagerAsh will keep
+ // this state, while also forwarding it to the window manager for us.
+ if (GetAshConfig() == Config::MUS)
+ Shell::Get()->cursor_manager()->LockCursor();
+ else
+ window_manager_->window_manager_client()->LockCursor();
}
void ShellPortMash::UnlockCursor() {
- window_manager_->window_manager_client()->UnlockCursor();
+ if (GetAshConfig() == Config::MUS)
+ Shell::Get()->cursor_manager()->UnlockCursor();
+ else
+ window_manager_->window_manager_client()->UnlockCursor();
}
void ShellPortMash::ShowCursor() {
- window_manager_->window_manager_client()->SetCursorVisible(true);
+ if (GetAshConfig() == Config::MUS)
+ Shell::Get()->cursor_manager()->ShowCursor();
+ else
+ window_manager_->window_manager_client()->SetCursorVisible(true);
}
void ShellPortMash::HideCursor() {
- window_manager_->window_manager_client()->SetCursorVisible(false);
+ if (GetAshConfig() == Config::MUS)
+ Shell::Get()->cursor_manager()->HideCursor();
+ else
+ window_manager_->window_manager_client()->SetCursorVisible(false);
}
void ShellPortMash::SetCursorSize(ui::CursorSize cursor_size) {
- window_manager_->window_manager_client()->SetCursorSize(cursor_size);
+ if (GetAshConfig() == Config::MUS)
+ Shell::Get()->cursor_manager()->SetCursorSize(cursor_size);
+ else
+ window_manager_->window_manager_client()->SetCursorSize(cursor_size);
}
void ShellPortMash::SetGlobalOverrideCursor(
base::Optional<ui::CursorData> cursor) {
+ DCHECK(mash_state_);
window_manager_->window_manager_client()->SetGlobalOverrideCursor(
std::move(cursor));
}
« no previous file with comments | « no previous file | ash/wm/native_cursor_manager_ash_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698