[Webkit-unassigned] [Bug 18464] incorrect translation of wxMouse event to webkit mouse event
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Apr 17 06:43:02 PDT 2008
http://bugs.webkit.org/show_bug.cgi?id=18464
------- Comment #6 from avasilev at voipgate.com 2008-04-17 06:43 PDT -------
(In reply to comment #5)
> Looking at the stack trace you posted (please make sure to post the trace to
> the relevant bug in the future, as this is a record of all our debugging work,
> etc.), it looks to me like the assertion is fired due to a bug in your patch.
>
> handleMouseReleaseEvent is triggering ASSERT(event.eventType() ==
> MouseEventMoved || button != NoButton). Since it's a mouse release event, the
> eventType() should not be MouseEventMoved, so that leaves button != NoButton.
> And in your code, you do not set a button for the wxEVT_*_DCLICK case, so it
> makes sense that this assertion would get triggered. Are you getting this crash
> on an unmodified copy of MouseEventWx.cpp, or on your modified copy?
>
No no, I am getting the crash on an unmodified copy! After my patch I get no
more crashes any more, and all works fine! Here is the original code:
PlatformMouseEvent::PlatformMouseEvent(const wxMouseEvent& event, const
wxPoint& globalPoint)
: m_position(event.GetPosition())
, m_globalPosition(globalPoint)
, m_clickCount(event.ButtonDClick() ? 2 : 1)
, m_shiftKey(event.ShiftDown())
, m_ctrlKey(event.CmdDown())
, m_altKey(event.AltDown())
, m_metaKey(event.MetaDown()) // FIXME: We'll have to test other browsers
{
wxEventType type = event.GetEventType();
m_eventType = MouseEventMoved;
if (type == wxEVT_LEFT_DOWN || type == wxEVT_MIDDLE_DOWN || type ==
wxEVT_RIGHT_DOWN)
m_eventType = MouseEventPressed;
else if (type == wxEVT_LEFT_UP || type == wxEVT_MIDDLE_UP || type ==
wxEVT_RIGHT_UP ||
type == wxEVT_LEFT_DCLICK || type == wxEVT_MIDDLE_DCLICK ||
type == wxEVT_RIGHT_DCLICK)
m_eventType = MouseEventReleased;
else if (type == wxEVT_MOTION)
m_eventType = MouseEventMoved;
if (event.LeftIsDown())
m_button = LeftButton;
else if (event.RightIsDown())
m_button = RightButton;
else if (event.MiddleIsDown())
m_button = MiddleButton;
}
So you can see that m_button is set ONLY on mouse down events, not on mouse
release or dclick events! What triggers the crash is exactly mouse release or
doubleclick event. You are completely right that my patch leaved m_button
unset on mouse doubleclick, I figured out this few days ago and fixed it as
well, but didn't want to flood with patches. So now I will attach my complete
patch
--
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the webkit-unassigned
mailing list