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

Issue 12317157: Fix touch scaling for high dpi windows. (Closed)

Created:
7 years, 9 months ago by girard
Modified:
7 years, 9 months ago
Reviewers:
sky, Ryan Sleevi
CC:
chromium-reviews, yusukes+watch_chromium.org, jam, penghuang+watch_chromium.org, joi+watch-content_chromium.org, darin-cc_chromium.org, James Su
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Fix touch scaling for high dpi windows. Touch events in windows are always expressed in screen coordinates, even if the target app is not dpi-aware. This patch determines the dpi scale used by the OS, and re-scales touch events accordingly. In some cases the touch events are sent to the wrong window. This is detected and corrected. BUG=175542 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=185474 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=186187

Patch Set 1 #

Patch Set 2 : Update to use Metro/Win8-Friendly registry setting. #

Patch Set 3 : Fix for metro mode #

Patch Set 4 : Adding extra safety logic to address XP failure. #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+74 lines, -5 lines) Patch
M content/browser/renderer_host/render_widget_host_view_win.cc View 2 chunks +5 lines, -4 lines 0 comments Download
M ui/base/win/dpi.h View 1 chunk +2 lines, -0 lines 0 comments Download
M ui/base/win/dpi.cc View 1 2 3 4 chunks +47 lines, -1 line 2 comments Download
M ui/base/win/hwnd_subclass.cc View 2 chunks +20 lines, -0 lines 1 comment Download

Messages

Total messages: 12 (0 generated)
girard
Until we become High-DPI aware, we need to correct touch coordinates. (The OS auto-scales most ...
7 years, 9 months ago (2013-02-28 18:22:13 UTC) #1
sky
LGTM
7 years, 9 months ago (2013-02-28 21:43:06 UTC) #2
girard
On 2013/02/28 21:43:06, sky wrote: > LGTM Thanks, Sky. Minor addition - it turns out ...
7 years, 9 months ago (2013-02-28 22:05:43 UTC) #3
sky
SLGTM
7 years, 9 months ago (2013-02-28 22:22:23 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/girard@chromium.org/12317157/5005
7 years, 9 months ago (2013-03-01 04:35:36 UTC) #5
commit-bot: I haz the power
Change committed as 185474
7 years, 9 months ago (2013-03-01 07:21:06 UTC) #6
girard
On 2013/03/01 07:21:06, I haz the power (commit-bot) wrote: > Change committed as 185474 Change ...
7 years, 9 months ago (2013-03-04 18:52:55 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/girard@chromium.org/12317157/5005
7 years, 9 months ago (2013-03-04 18:53:20 UTC) #8
commit-bot: I haz the power
Failed to apply patch for ui/base/win/dpi.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 9 months ago (2013-03-04 18:53:21 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/girard@chromium.org/12317157/7004
7 years, 9 months ago (2013-03-05 13:55:10 UTC) #10
commit-bot: I haz the power
Change committed as 186187
7 years, 9 months ago (2013-03-05 16:43:27 UTC) #11
Ryan Sleevi
7 years, 9 months ago (2013-03-05 18:32:56 UTC) #12
Message was sent while issue was closed.
drive by comments and nits.

Note: You should open a new issue (git cl issue 0), upload the
existing-as-landed, then upload the fixed version, and have that landed. You
should not re-use the same codereview CL to land the same patch multiple times.

https://chromiumcodereview.appspot.com/12317157/diff/7004/ui/base/win/dpi.cc
File ui/base/win/dpi.cc (right):

https://chromiumcodereview.appspot.com/12317157/diff/7004/ui/base/win/dpi.cc#...
ui/base/win/dpi.cc:130: //HKEY_CURRENT_USER\Control
Panel\Desktop\WindowMetrics\AppliedDPI
nit: space between //

https://chromiumcodereview.appspot.com/12317157/diff/7004/ui/base/win/dpi.cc#...
ui/base/win/dpi.cc:138: result = ((double)value) / kDefaultDPIX;
style: Don't do C-casts

https://chromiumcodereview.appspot.com/12317157/diff/7004/ui/base/win/hwnd_su...
File ui/base/win/hwnd_subclass.cc (right):

https://chromiumcodereview.appspot.com/12317157/diff/7004/ui/base/win/hwnd_su...
ui/base/win/hwnd_subclass.cc:131: &point, sizeof(TOUCHINPUT))) {
style: indentation
BUG: GetTouchInputInfo is only available on Win7+. You need to
GetProcAdress-wrap this function

Powered by Google App Engine
This is Rietveld 408576698