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

Unified Diff: ui/views/win/hwnd_message_handler.cc

Issue 145513004: Fix the 17px dead region in the bottom right corner of top level browser windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/win/hwnd_message_handler.cc
===================================================================
--- ui/views/win/hwnd_message_handler.cc (revision 247284)
+++ ui/views/win/hwnd_message_handler.cc (working copy)
@@ -1905,16 +1905,49 @@
#if defined(USE_AURA)
LRESULT hit_test_code = DefWindowProc(hwnd(), WM_NCHITTEST, 0,
MAKELPARAM(point.x, point.y));
- // If we faked the WS_VSCROLL and WS_HSCROLL styles for this window, then
- // Windows returns the HTVSCROLL or HTHSCROLL hit test codes if we hover or
- // click on the non client portions of the window where the OS scrollbars
- // would be drawn. These hittest codes are returned even when the scrollbars
- // are hidden, which is the case in Aura. We fake the hittest code as
- // HTCLIENT in this case to ensure that we receive client mouse messages as
- // opposed to non client mouse messages.
- if (needs_scroll_styles_ && (hit_test_code == HTVSCROLL ||
- hit_test_code == HTHSCROLL))
- hit_test_code = HTCLIENT;
+ if (needs_scroll_styles_) {
+ switch (hit_test_code) {
+ // If we faked the WS_VSCROLL and WS_HSCROLL styles for this window, then
+ // Windows returns the HTVSCROLL or HTHSCROLL hit test codes if we hover
+ // or click on the non client portions of the window where the OS
+ // scrollbars would be drawn. These hittest codes are returned even when
+ // the scrollbars are hidden, which is the case in Aura. We fake the
+ // hittest code as HTCLIENT in this case to ensure that we receive client
+ // mouse messages as opposed to non client mouse messages.
+ case HTVSCROLL:
+ case HTHSCROLL:
+ hit_test_code = HTCLIENT;
+ break;
+
+ case HTBOTTOMRIGHT: {
+ // Normally the HTBOTTOMRIGHT hittest code is received when we hover
+ // near the bottom right of the window. However due to our fake scroll
+ // styles, we get this code even when we hover around the area where
+ // the vertical scrollar down arrow would be drawn.
+ // We check if the hittest coordinates lie in this region and if yes
+ // we return HTCLIENT.
+ int border_width = ::GetSystemMetrics(SM_CXSIZEFRAME);
+ int border_height = ::GetSystemMetrics(SM_CYSIZEFRAME);
+ int scroll_width = ::GetSystemMetrics(SM_CXVSCROLL);
+ int scroll_height = ::GetSystemMetrics(SM_CYVSCROLL);
+ RECT window_rect;
+ ::GetWindowRect(hwnd(), &window_rect);
+ window_rect.bottom -= border_height;
+ window_rect.right -= border_width;
+ window_rect.left = window_rect.right - scroll_width;
+ window_rect.top = window_rect.bottom - scroll_height;
+ POINT pt;
+ pt.x = point.x;
+ pt.y = point.y;
+ if (::PtInRect(&window_rect, pt))
+ hit_test_code = HTCLIENT;
+ break;
+ }
+
+ default:
+ break;
+ }
+ }
return hit_test_code;
#else
SetMsgHandled(FALSE);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698