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

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

Issue 2925853002: Flag mouse messages received when cursor is hidden.
Patch Set: Rebase Created 3 years, 6 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 | « ui/views/win/hwnd_message_handler.h ('k') | 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
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 4f9ad05241a7b18d9d93f493d1c6567bb57c47e5..96932698c6f8eda592300014ae95bc20e8a1584f 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -320,8 +320,6 @@ base::LazyInstance<HWNDMessageHandler::FullscreenWindowMonitorMap>::
////////////////////////////////////////////////////////////////////////////////
// HWNDMessageHandler, public:
-long HWNDMessageHandler::last_touch_message_time_ = 0;
-
HWNDMessageHandler::HWNDMessageHandler(HWNDMessageHandlerDelegate* delegate)
: msg_handled_(FALSE),
delegate_(delegate),
@@ -2336,8 +2334,6 @@ LRESULT HWNDMessageHandler::OnTouchEvent(UINT message,
ScreenToClient(hwnd(), &point);
- last_touch_message_time_ = ::GetMessageTime();
-
gfx::Point touch_point(point.x, point.y);
unsigned int touch_id = id_generator_.GetGeneratedID(input[i].dwID);
@@ -2654,8 +2650,10 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
static_cast<DWORD>(message_time),
{ CR_GET_X_LPARAM(l_param), CR_GET_Y_LPARAM(l_param) } };
ui::MouseEvent event(msg);
- if (IsSynthesizedMouseMessage(message, message_time, l_param))
+ if (ui::IsMouseEventFromTouch(message))
event.set_flags(event.flags() | ui::EF_FROM_TOUCH);
+ if (ui::IsWindowsCursorHidden())
+ event.set_flags(event.flags() | ui::EF_CURSOR_HIDDEN);
if (event.type() == ui::ET_MOUSE_MOVED && !HasCapture() && track_mouse) {
// Windows only fires WM_MOUSELEAVE events if the application begins
@@ -2710,28 +2708,6 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
return 0;
}
-bool HWNDMessageHandler::IsSynthesizedMouseMessage(unsigned int message,
- int message_time,
- LPARAM l_param) {
- if (ui::IsMouseEventFromTouch(message))
- return true;
- // Ignore mouse messages which occur at the same location as the current
- // cursor position and within a time difference of 500 ms from the last
- // touch message.
- if (last_touch_message_time_ && message_time >= last_touch_message_time_ &&
- ((message_time - last_touch_message_time_) <=
- kSynthesizedMouseTouchMessagesTimeDifference)) {
- POINT mouse_location = CR_POINT_INITIALIZER_FROM_LPARAM(l_param);
- ::ClientToScreen(hwnd(), &mouse_location);
- POINT cursor_pos = {0};
- ::GetCursorPos(&cursor_pos);
- if (memcmp(&cursor_pos, &mouse_location, sizeof(POINT)))
- return false;
- return true;
- }
- return false;
-}
-
void HWNDMessageHandler::PerformDwmTransition() {
dwm_transition_desired_ = false;
« no previous file with comments | « ui/views/win/hwnd_message_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698