Commit 7ddd11b0 authored by kevino@webkit.org's avatar kevino@webkit.org

Reviewed by Eric Seidel.

Make sure we properly set the button for all mouse events, not just mouse down, set the click count to 0 for non-click events, and finally set the timestamp.
        
https://bugs.webkit.org/show_bug.cgi?id=18464


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@32798 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 50d9efc7
2008-05-01 Kevin Ollivier <kevino@theolliviers.com>
Reviewed by Eric Seidel.
Make sure we properly set the button for all mouse events,
not just mouse down, set the click count to 0
for non-click events, and finally set the timestamp.
https://bugs.webkit.org/show_bug.cgi?id=18464
* platform/wx/MouseEventWx.cpp:
(WebCore::PlatformMouseEvent::PlatformMouseEvent):
2008-05-01 Sam Weinig <sam@webkit.org>
Reviewed by Mark Rowe (in his infinite wisdom).
......@@ -24,7 +24,9 @@
*/
#include "config.h"
#include "Assertions.h"
#include "PlatformMouseEvent.h"
#include "SystemTime.h"
#include <wx/defs.h>
#include <wx/event.h>
......@@ -34,7 +36,6 @@ namespace WebCore {
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())
......@@ -53,12 +54,22 @@ PlatformMouseEvent::PlatformMouseEvent(const wxMouseEvent& event, const wxPoint&
else if (type == wxEVT_MOTION)
m_eventType = MouseEventMoved;
if (event.LeftIsDown())
if (event.Button(wxMOUSE_BTN_LEFT))
m_button = LeftButton;
else if (event.RightIsDown())
else if (event.Button(wxMOUSE_BTN_RIGHT))
m_button = RightButton;
else if (event.MiddleIsDown())
else if (event.Button(wxMOUSE_BTN_MIDDLE))
m_button = MiddleButton;
else if (!m_eventType == MouseEventMoved)
ASSERT_NOT_REACHED();
if (m_eventType == MouseEventMoved)
m_clickCount = 0;
else
m_clickCount = event.ButtonDClick() ? 2 : 1;
m_timestamp = WebCore::currentTime();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment