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

Unified Diff: win8/metro_driver/chrome_app_view_ash.cc

Issue 560633002: Ensure that mouse lock works correctly on Chrome ASH in Windows 8. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Build errors Created 6 years, 3 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 | « win8/metro_driver/chrome_app_view_ash.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: win8/metro_driver/chrome_app_view_ash.cc
diff --git a/win8/metro_driver/chrome_app_view_ash.cc b/win8/metro_driver/chrome_app_view_ash.cc
index 0e1d0e75a5837af9930a48cb117684648c270037..8e3adf20ad8277d3acb45c365ee413fc03058600 100644
--- a/win8/metro_driver/chrome_app_view_ash.cc
+++ b/win8/metro_driver/chrome_app_view_ash.cc
@@ -530,7 +530,8 @@ ChromeAppViewAsh::ChromeAppViewAsh()
ui_channel_(nullptr),
core_window_hwnd_(NULL),
metro_dpi_scale_(0),
- win32_dpi_scale_(0) {
+ win32_dpi_scale_(0),
+ last_cursor_(NULL) {
DVLOG(1) << __FUNCTION__;
globals.previous_state =
winapp::Activation::ApplicationExecutionState_NotRunning;
@@ -815,7 +816,8 @@ void ChromeAppViewAsh::OnOpenURLOnDesktop(const base::FilePath& shortcut,
}
void ChromeAppViewAsh::OnSetCursor(HCURSOR cursor) {
- ::SetCursor(HCURSOR(cursor));
+ ::SetCursor(cursor);
+ last_cursor_ = cursor;
}
void ChromeAppViewAsh::OnDisplayFileOpenDialog(
@@ -1082,6 +1084,11 @@ HRESULT ChromeAppViewAsh::OnPointerMoved(winui::Core::ICoreWindow* sender,
return hr;
if (pointer.IsMouse()) {
+ // If the mouse was moved towards the charms or the OS specific section,
+ // the cursor may change from what the browser last set. Restore it here.
+ if (::GetCursor() != last_cursor_)
+ SetCursor(last_cursor_);
+
GenerateMouseEventFromMoveIfNecessary(pointer);
ui_channel_->Send(new MetroViewerHostMsg_MouseMoved(
pointer.x(),
« no previous file with comments | « win8/metro_driver/chrome_app_view_ash.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698