[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.22-985-g3c00f00

eric at webkit.org eric at webkit.org
Wed Mar 17 17:56:31 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit f91d6b2a48f802141412edf8fe1a4821064fd6fb
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Feb 23 01:29:08 2010 +0000

    2010-02-22  Stephan Aßmus  <superstippi at gmx.de>
    
            Reviewed by Eric Seidel.
    
            Fix various issues in PlatformMouseEventHaiku.
            https://bugs.webkit.org/show_bug.cgi?id=34685
    
            Covered by existing tests.
    
            Mapping Haiku button constants (bit field) to WebCore buttons was broken.
            Extracting event time was broken (supposed to be in seconds).
            Wrong coordinate was being extracted, needs to be content local.
            Added extracting modifier key flags.
    
            * platform/haiku/PlatformMouseEventHaiku.cpp:
            (WebCore::PlatformMouseEvent::PlatformMouseEvent):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55116 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 87863c4..0954147 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -2,6 +2,23 @@
 
         Reviewed by Eric Seidel.
 
+        Fix various issues in PlatformMouseEventHaiku.
+        https://bugs.webkit.org/show_bug.cgi?id=34685
+
+        Covered by existing tests.
+        
+        Mapping Haiku button constants (bit field) to WebCore buttons was broken.
+        Extracting event time was broken (supposed to be in seconds).
+        Wrong coordinate was being extracted, needs to be content local.
+        Added extracting modifier key flags.
+
+        * platform/haiku/PlatformMouseEventHaiku.cpp:
+        (WebCore::PlatformMouseEvent::PlatformMouseEvent):
+
+2010-02-22  Stephan Aßmus  <superstippi at gmx.de>
+
+        Reviewed by Eric Seidel.
+
         [Haiku] Implement creating and filling platform gradients.
         https://bugs.webkit.org/show_bug.cgi?id=34683
 
diff --git a/WebCore/platform/haiku/PlatformMouseEventHaiku.cpp b/WebCore/platform/haiku/PlatformMouseEventHaiku.cpp
index d212f8b..f1051a5 100644
--- a/WebCore/platform/haiku/PlatformMouseEventHaiku.cpp
+++ b/WebCore/platform/haiku/PlatformMouseEventHaiku.cpp
@@ -1,6 +1,7 @@
 /*
  * Copyright (C) 2007 Ryan Leavengood <leavengood at gmail.com>
  * Copyright (C) 2009 Maxime Simon <simon.maxime at gmail.com>
+ * Copyright (C) 2010 Stephan Aßmus <superstippi at gmx.de>
  *
  * All rights reserved.
  *
@@ -30,36 +31,30 @@
 #include "PlatformMouseEvent.h"
 
 #include <Message.h>
-#include <SupportDefs.h>
-
+#include <View.h>
 
 namespace WebCore {
 
 PlatformMouseEvent::PlatformMouseEvent(const BMessage* message)
-    : m_timestamp(message->FindInt64("when"))
-    , m_position(IntPoint(message->FindPoint("where")))
-    , m_globalPosition(message->FindPoint("globalPosition"))
-    , m_shiftKey(false)
-    , m_ctrlKey(false)
-    , m_altKey(false)
-    , m_metaKey(false)
+    : m_position(message->FindPoint("be:view_where"))
+    , m_globalPosition(message->FindPoint("screen_where"))
     , m_clickCount(message->FindInt32("clicks"))
+    , m_timestamp(message->FindInt64("when") / 1000000.0)
 {
-    int32 buttons = message->FindInt32("buttons");
-    switch (buttons) {
-    case 1:
+    int32 buttons = 0;
+    if (message->what == B_MOUSE_UP)
+        message->FindInt32("previous buttons", &buttons);
+    else
+        message->FindInt32("buttons", &buttons);
+
+    if (buttons & B_PRIMARY_MOUSE_BUTTON)
         m_button = LeftButton;
-        break;
-    case 2:
+    else if (buttons & B_SECONDARY_MOUSE_BUTTON)
         m_button = RightButton;
-        break;
-    case 3:
+    else if (buttons & B_TERTIARY_MOUSE_BUTTON)
         m_button = MiddleButton;
-        break;
-    default:
+    else
         m_button = NoButton;
-        break;
-    };
 
     switch (message->what) {
     case B_MOUSE_DOWN:
@@ -67,15 +62,18 @@ PlatformMouseEvent::PlatformMouseEvent(const BMessage* message)
         break;
     case B_MOUSE_UP:
         m_eventType = MouseEventReleased;
-        m_button = LeftButton; // FIXME: Webcore wants to know the button released but we don't know.
         break;
     case B_MOUSE_MOVED:
-        m_eventType = MouseEventMoved;
-        break;
     default:
         m_eventType = MouseEventMoved;
         break;
     };
+
+    int32 modifiers = message->FindInt32("modifiers");
+    m_shiftKey = modifiers & B_SHIFT_KEY;
+    m_ctrlKey = modifiers & B_CONTROL_KEY;
+    m_altKey = modifiers & B_COMMAND_KEY;
+    m_metaKey = modifiers & B_OPTION_KEY;
 }
 
 } // namespace WebCore

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list