mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-25 20:01:50 +00:00
Fix cursor bug which caused cursor to be set once per child view on each mousemove
This commit is contained in:
parent
fff8fe4b1e
commit
946548a531
@ -81,7 +81,7 @@ nsEventStateManager::PreHandleEvent(nsIPresContext& aPresContext,
|
||||
|
||||
switch (aEvent->message) {
|
||||
case NS_MOUSE_MOVE:
|
||||
UpdateCursor(aPresContext, aEvent->point, aTargetFrame);
|
||||
UpdateCursor(aPresContext, aEvent->point, aTargetFrame, aStatus);
|
||||
GenerateMouseEnterExit(aPresContext, aEvent);
|
||||
break;
|
||||
case NS_MOUSE_EXIT:
|
||||
@ -162,7 +162,8 @@ nsEventStateManager::ClearFrameRefs(nsIFrame* aFrame)
|
||||
}
|
||||
|
||||
void
|
||||
nsEventStateManager::UpdateCursor(nsIPresContext& aPresContext, nsPoint& aPoint, nsIFrame* aTargetFrame)
|
||||
nsEventStateManager::UpdateCursor(nsIPresContext& aPresContext, nsPoint& aPoint, nsIFrame* aTargetFrame,
|
||||
nsEventStatus& aStatus)
|
||||
{
|
||||
PRInt32 cursor;
|
||||
nsCursor c;
|
||||
@ -202,6 +203,11 @@ nsEventStateManager::UpdateCursor(nsIPresContext& aPresContext, nsPoint& aPoint,
|
||||
c = eCursor_select;
|
||||
break;
|
||||
}
|
||||
|
||||
if (NS_STYLE_CURSOR_AUTO != cursor) {
|
||||
aStatus = nsEventStatus_eConsumeDoDefault;
|
||||
}
|
||||
|
||||
nsIWidget* window;
|
||||
aTargetFrame->GetWindow(window);
|
||||
window->SetCursor(c);
|
||||
|
@ -55,7 +55,7 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
void UpdateCursor(nsIPresContext& aPresContext, nsPoint& aPoint, nsIFrame* aTargetFrame);
|
||||
void UpdateCursor(nsIPresContext& aPresContext, nsPoint& aPoint, nsIFrame* aTargetFrame, nsEventStatus& aStatus);
|
||||
void GenerateMouseEnterExit(nsIPresContext& aPresContext, nsGUIEvent* aEvent);
|
||||
NS_IMETHOD DispatchKeyPressEvent(nsIPresContext& aPresContext, nsKeyEvent *aEvent, nsEventStatus& aStatus);
|
||||
NS_IMETHOD CheckForAndDispatchClick(nsIPresContext& aPresContext, nsMouseEvent *aEvent, nsEventStatus& aStatus);
|
||||
|
@ -81,7 +81,7 @@ nsEventStateManager::PreHandleEvent(nsIPresContext& aPresContext,
|
||||
|
||||
switch (aEvent->message) {
|
||||
case NS_MOUSE_MOVE:
|
||||
UpdateCursor(aPresContext, aEvent->point, aTargetFrame);
|
||||
UpdateCursor(aPresContext, aEvent->point, aTargetFrame, aStatus);
|
||||
GenerateMouseEnterExit(aPresContext, aEvent);
|
||||
break;
|
||||
case NS_MOUSE_EXIT:
|
||||
@ -162,7 +162,8 @@ nsEventStateManager::ClearFrameRefs(nsIFrame* aFrame)
|
||||
}
|
||||
|
||||
void
|
||||
nsEventStateManager::UpdateCursor(nsIPresContext& aPresContext, nsPoint& aPoint, nsIFrame* aTargetFrame)
|
||||
nsEventStateManager::UpdateCursor(nsIPresContext& aPresContext, nsPoint& aPoint, nsIFrame* aTargetFrame,
|
||||
nsEventStatus& aStatus)
|
||||
{
|
||||
PRInt32 cursor;
|
||||
nsCursor c;
|
||||
@ -202,6 +203,11 @@ nsEventStateManager::UpdateCursor(nsIPresContext& aPresContext, nsPoint& aPoint,
|
||||
c = eCursor_select;
|
||||
break;
|
||||
}
|
||||
|
||||
if (NS_STYLE_CURSOR_AUTO != cursor) {
|
||||
aStatus = nsEventStatus_eConsumeDoDefault;
|
||||
}
|
||||
|
||||
nsIWidget* window;
|
||||
aTargetFrame->GetWindow(window);
|
||||
window->SetCursor(c);
|
||||
|
@ -55,7 +55,7 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
void UpdateCursor(nsIPresContext& aPresContext, nsPoint& aPoint, nsIFrame* aTargetFrame);
|
||||
void UpdateCursor(nsIPresContext& aPresContext, nsPoint& aPoint, nsIFrame* aTargetFrame, nsEventStatus& aStatus);
|
||||
void GenerateMouseEnterExit(nsIPresContext& aPresContext, nsGUIEvent* aEvent);
|
||||
NS_IMETHOD DispatchKeyPressEvent(nsIPresContext& aPresContext, nsKeyEvent *aEvent, nsEventStatus& aStatus);
|
||||
NS_IMETHOD CheckForAndDispatchClick(nsIPresContext& aPresContext, nsMouseEvent *aEvent, nsEventStatus& aStatus);
|
||||
|
Loading…
x
Reference in New Issue
Block a user