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

Unified Diff: content/browser/renderer_host/input/web_input_event_builders_win.cc

Issue 981393002: Second attempt at fixing pointer lock issues with Windows HiDPI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added the files for the test Created 5 years, 9 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
Index: content/browser/renderer_host/input/web_input_event_builders_win.cc
diff --git a/content/browser/renderer_host/input/web_input_event_builders_win.cc b/content/browser/renderer_host/input/web_input_event_builders_win.cc
index 831f4034b279f2187ac12f9473dba6ed56c025e9..30034ee0119c1585e79ab80bfbefce4bd5649bf1 100644
--- a/content/browser/renderer_host/input/web_input_event_builders_win.cc
+++ b/content/browser/renderer_host/input/web_input_event_builders_win.cc
@@ -251,24 +251,15 @@ WebMouseEvent WebMouseEventBuilder::Build(HWND hwnd,
result.windowX = result.x;
result.windowY = result.y;
- // The mouse coordinates received here are device independent (DIPs). We need
- // to convert them to physical coordinates before calling Windows APIs like
- // ClientToScreen, etc.
- gfx::Point scaled_screen_point(result.x, result.y);
- scaled_screen_point = gfx::win::DIPToScreenPoint(scaled_screen_point);
-
- POINT global_point = { scaled_screen_point.x(), scaled_screen_point.y() };
+ POINT global_point = { result.x, result.y };
ClientToScreen(hwnd, &global_point);
- scaled_screen_point.set_x(global_point.x);
- scaled_screen_point.set_y(global_point.y);
-
- // We need to convert the point back to DIP before using it.
- gfx::Point dip_screen_point = gfx::win::ScreenToDIPPoint(
- scaled_screen_point);
+ // We need to convert the global point back to DIP before using it.
+ gfx::Point dip_global_point = gfx::win::ScreenToDIPPoint(
+ gfx::Point(global_point.x, global_point.y));
- result.globalX = dip_screen_point.x();
- result.globalY = dip_screen_point.y();
+ result.globalX = dip_global_point.x();
+ result.globalY = dip_global_point.y();
// calculate number of clicks:

Powered by Google App Engine
This is Rietveld 408576698