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

Issue 341763002: Ensure that mouse events on Windows reposted by the menu_controller are converted to pixel. (Closed)

Created:
6 years, 6 months ago by ananta
Modified:
6 years, 6 months ago
Reviewers:
oshima, sky
CC:
chromium-reviews, tfarina
Project:
chromium
Visibility:
Public.

Description

Ensure that mouse events on Windows reposted by the menu_controller are converted to pixel. On HiDPI windows these coordinates are in DIPs. While posting them via the PostMessage API we need to convert them back to pixel using the correct scale factor. This caused bookmarks to get incorrectly saved at times. Changes in this patch are as below:- 1. menu_controller.cc. Convert screen_loc to pixels before invoking Win32 API's as they expect values in pixels. 2. screen_win.cc. Fix the GetWindowAtScreenPoint function to convert the point to pixels before invoking the WindowFromPoint API. BUG=381605 R=sky Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=278559

Patch Set 1 #

Patch Set 2 : Fixed code #

Total comments: 2

Patch Set 3 : Code review comments #

Total comments: 3

Patch Set 4 : Reverted changes to menu_controller and fixed screen_win.cc #

Patch Set 5 : Convert screen_loc to pixels in menu_controller.cc #

Total comments: 2

Patch Set 6 : Code review comments #

Total comments: 2

Patch Set 7 : Code review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -5 lines) Patch
M ui/gfx/screen_win.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M ui/views/controls/menu/menu_controller.cc View 1 2 3 4 5 6 4 chunks +9 lines, -4 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
ananta
6 years, 6 months ago (2014-06-18 04:34:29 UTC) #1
sky
https://codereview.chromium.org/341763002/diff/40001/ui/views/controls/menu/menu_controller.cc File ui/views/controls/menu/menu_controller.cc (right): https://codereview.chromium.org/341763002/diff/40001/ui/views/controls/menu/menu_controller.cc#newcode2053 ui/views/controls/menu/menu_controller.cc:2053: gfx::NativeWindow window = screen->GetWindowAtScreenPoint(screen_loc); Move this so that we ...
6 years, 6 months ago (2014-06-18 13:15:59 UTC) #2
ananta
https://codereview.chromium.org/341763002/diff/40001/ui/views/controls/menu/menu_controller.cc File ui/views/controls/menu/menu_controller.cc (right): https://codereview.chromium.org/341763002/diff/40001/ui/views/controls/menu/menu_controller.cc#newcode2053 ui/views/controls/menu/menu_controller.cc:2053: gfx::NativeWindow window = screen->GetWindowAtScreenPoint(screen_loc); On 2014/06/18 13:15:59, sky wrote: ...
6 years, 6 months ago (2014-06-18 18:53:41 UTC) #3
sky
+oshima https://codereview.chromium.org/341763002/diff/60001/ui/views/controls/menu/menu_controller.cc File ui/views/controls/menu/menu_controller.cc (right): https://codereview.chromium.org/341763002/diff/60001/ui/views/controls/menu/menu_controller.cc#newcode109 ui/views/controls/menu/menu_controller.cc:109: *window = screen->GetWindowAtScreenPoint(screen_loc); Something seems wrong here. Why ...
6 years, 6 months ago (2014-06-18 22:20:26 UTC) #4
oshima
https://codereview.chromium.org/341763002/diff/60001/ui/views/controls/menu/menu_controller.cc File ui/views/controls/menu/menu_controller.cc (right): https://codereview.chromium.org/341763002/diff/60001/ui/views/controls/menu/menu_controller.cc#newcode109 ui/views/controls/menu/menu_controller.cc:109: *window = screen->GetWindowAtScreenPoint(screen_loc); On 2014/06/18 22:20:26, sky wrote: > ...
6 years, 6 months ago (2014-06-18 22:27:51 UTC) #5
ananta
https://codereview.chromium.org/341763002/diff/60001/ui/views/controls/menu/menu_controller.cc File ui/views/controls/menu/menu_controller.cc (right): https://codereview.chromium.org/341763002/diff/60001/ui/views/controls/menu/menu_controller.cc#newcode109 ui/views/controls/menu/menu_controller.cc:109: *window = screen->GetWindowAtScreenPoint(screen_loc); On 2014/06/18 22:20:26, sky wrote: > ...
6 years, 6 months ago (2014-06-18 22:57:11 UTC) #6
sky
Did you look into other call sites to make sure the screen_win change isn't going ...
6 years, 6 months ago (2014-06-19 00:55:12 UTC) #7
ananta
I looked over the usage of GetWindowAtScreenPoint in the code base. The ScreenWin change should ...
6 years, 6 months ago (2014-06-19 01:44:18 UTC) #8
sky
LGTM https://codereview.chromium.org/341763002/diff/120001/ui/views/controls/menu/menu_controller.cc File ui/views/controls/menu/menu_controller.cc (right): https://codereview.chromium.org/341763002/diff/120001/ui/views/controls/menu/menu_controller.cc#newcode2058 ui/views/controls/menu/menu_controller.cc:2058: gfx::Point screen_loc_pixels = gfx::win::DIPToScreenPoint(screen_loc); nit: move into conditional ...
6 years, 6 months ago (2014-06-19 15:33:32 UTC) #9
ananta
https://codereview.chromium.org/341763002/diff/120001/ui/views/controls/menu/menu_controller.cc File ui/views/controls/menu/menu_controller.cc (right): https://codereview.chromium.org/341763002/diff/120001/ui/views/controls/menu/menu_controller.cc#newcode2058 ui/views/controls/menu/menu_controller.cc:2058: gfx::Point screen_loc_pixels = gfx::win::DIPToScreenPoint(screen_loc); On 2014/06/19 15:33:32, sky wrote: ...
6 years, 6 months ago (2014-06-19 18:45:26 UTC) #10
ananta
The CQ bit was checked by ananta@chromium.org
6 years, 6 months ago (2014-06-19 19:30:46 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ananta@chromium.org/341763002/140001
6 years, 6 months ago (2014-06-19 19:32:54 UTC) #12
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_aosp on tryserver.chromium ...
6 years, 6 months ago (2014-06-19 23:59:37 UTC) #13
commit-bot: I haz the power
6 years, 6 months ago (2014-06-20 00:50:26 UTC) #14
Message was sent while issue was closed.
Change committed as 278559

Powered by Google App Engine
This is Rietveld 408576698