[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:56:03 PDT 2008


http://bugs.webkit.org/show_bug.cgi?id=18464


avasilev at voipgate.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #20626|mouseEventWx.patch          |newmouseevent3.patch
           filename|                            |




------- Comment #8 from avasilev at voipgate.com  2008-04-17 06:56 PDT -------
(From update of attachment 20626)
--- ./webkit_mingw/WebCore/platform/wx/MouseEventWx.cpp 2008-04-04
15:02:52.968750000 +0300
+++ ./webkit_clean/WebCore/platform/wx/MouseEventWx.cpp 2008-04-14
05:04:15.191625000 +0300
@@ -25,7 +25,7 @@

 #include "config.h"
 #include "PlatformMouseEvent.h"
-
+#include "SystemTime.h"
 #include <wx/defs.h>
 #include <wx/event.h>

@@ -34,7 +34,6 @@
 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())
@@ -43,22 +42,58 @@
     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;
+//strange, the compiler doeswnt allow us to use a switch here,  with wxEVT_xxx
cases, even though they are of the enum type of the 'type' variable
+//so we use if-s instead
+       if (type == wxEVT_LEFT_DOWN)
+         {
+               m_eventType = MouseEventPressed;
+               m_button = LeftButton;
+         }
+       else if (type == wxEVT_LEFT_UP)
+         {
+               m_eventType = MouseEventReleased;
+               m_button = LeftButton; 
+         }
+       else if (type == wxEVT_RIGHT_DOWN)
+         {
+               m_eventType = MouseEventPressed;
+               m_button = RightButton;
+         }
+       else if (type == wxEVT_RIGHT_UP)
+         {
+               m_eventType = MouseEventReleased;
+               m_button = RightButton;
+         }
+       else if (type == wxEVT_MIDDLE_DOWN)
+         {
+               m_eventType = MouseEventPressed;
+               m_button = MiddleButton;
+         }
+    else if (type == wxEVT_MIDDLE_UP)
+         {
+               m_eventType = MouseEventReleased;
+               m_button = MiddleButton;
+         }
+       else if (type == wxEVT_LEFT_DCLICK)
+         {
+               m_eventType = MouseEventReleased;
+               m_button = LeftButton;
+         }
+       else if (type == wxEVT_MIDDLE_DCLICK)
+         {
+               m_eventType = MouseEventReleased;
+               m_button = MiddleButton;
+         }     
+       else if (type == wxEVT_RIGHT_DCLICK)
+         {
+               m_eventType = MouseEventReleased;
+               m_button = RightButton;
+         }
+       if (m_eventType == MouseEventMoved)
+               m_clickCount = 0;
+         else
+               m_clickCount = event.ButtonDClick() ? 2 : 1;

-    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;
+       m_timestamp = WebCore::currentTime();
 }
-
 }


-- 
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