mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 664707. Special case converting event coordinates when the frame is the root frame in the widget. r=matspal
This has the side benefit of making events work in transformed select dropdown popups and is the real reason for making the change.
This commit is contained in:
parent
2fba78bac9
commit
ff961d36b5
@ -973,6 +973,21 @@ nsLayoutUtils::GetEventCoordinatesRelativeTo(const nsEvent* aEvent, nsIFrame* aF
|
||||
#else
|
||||
if (!GUIEvent->widget)
|
||||
return nsPoint(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
|
||||
|
||||
nsIView* view = aFrame->GetView();
|
||||
if (view) {
|
||||
nsIWidget* widget = view->GetWidget();
|
||||
if (widget && widget == GUIEvent->widget) {
|
||||
// Special case this cause it happens a lot.
|
||||
// This also fixes bug 664707, events in the extra-special case of select
|
||||
// dropdown popups that are transformed.
|
||||
nsPresContext* presContext = aFrame->PresContext();
|
||||
nsPoint pt(presContext->DevPixelsToAppUnits(GUIEvent->refPoint.x),
|
||||
presContext->DevPixelsToAppUnits(GUIEvent->refPoint.y));
|
||||
return pt - view->ViewToWidgetOffset();
|
||||
}
|
||||
}
|
||||
|
||||
/* If we walk up the frame tree and discover that any of the frames are
|
||||
* transformed, we need to do extra work to convert from the global
|
||||
* space to the local space.
|
||||
@ -1031,6 +1046,20 @@ nsLayoutUtils::GetEventCoordinatesRelativeTo(const nsEvent* aEvent,
|
||||
return nsPoint(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
|
||||
}
|
||||
|
||||
nsIView* view = aFrame->GetView();
|
||||
if (view) {
|
||||
nsIWidget* fwidget = view->GetWidget();
|
||||
if (fwidget && fwidget == GUIEvent->widget) {
|
||||
// Special case this cause it happens a lot.
|
||||
// This also fixes bug 664707, events in the extra-special case of select
|
||||
// dropdown popups that are transformed.
|
||||
nsPresContext* presContext = aFrame->PresContext();
|
||||
nsPoint pt(presContext->DevPixelsToAppUnits(GUIEvent->refPoint.x),
|
||||
presContext->DevPixelsToAppUnits(GUIEvent->refPoint.y));
|
||||
return pt - view->ViewToWidgetOffset();
|
||||
}
|
||||
}
|
||||
|
||||
/* If we walk up the frame tree and discover that any of the frames are
|
||||
* transformed, we need to do extra work to convert from the global
|
||||
* space to the local space.
|
||||
|
Loading…
Reference in New Issue
Block a user