Bug 841228 - Defect - Hover state on buttons (like the bookmark star) persists after you tap the button. r=jimm

This commit is contained in:
Brian R. Bondy 2013-04-04 12:17:53 -04:00
parent 851b1209b8
commit baddda006b

View File

@ -1265,6 +1265,23 @@ MetroInput::OnTapped(UI::Input::IGestureRecognizer* aSender,
// Send the mouseup
mouseEvent.message = NS_MOUSE_BUTTON_UP;
DispatchEventIgnoreStatus(&mouseEvent);
// Send one more mousemove to avoid getting a hover state.
// In the Metro environment for any application, a tap does not imply a
// mouse cursor move. In desktop environment for any application a tap
// does imply a cursor move.
POINT point;
if (GetCursorPos(&point)) {
ScreenToClient((HWND)mWidget->GetNativeData(NS_NATIVE_WINDOW), &point);
Foundation::Point oldMousePosition;
oldMousePosition.X = static_cast<FLOAT>(point.x);
oldMousePosition.Y = static_cast<FLOAT>(point.y);
mouseEvent.refPoint = MetroUtils::LogToPhys(oldMousePosition);
mouseEvent.message = NS_MOUSE_MOVE;
mouseEvent.button = 0;
DispatchEventIgnoreStatus(&mouseEvent);
}
}
return S_OK;