[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

mjs at apple.com mjs at apple.com
Wed Dec 22 18:21:13 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit b2113000c79e6a1d51af64eb7b5e5a919f3354e5
Author: mjs at apple.com <mjs at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Dec 10 02:45:53 2010 +0000

    2010-12-09  Maciej Stachowiak  <mjs at apple.com>
    
            Reviewed by Brady Eidson.
    
            WebKit2: Control-click doesn't invoke context menu
            https://bugs.webkit.org/show_bug.cgi?id=50793
            <rdar://problem/8664800>
    
            * WebProcess/WebPage/WebPage.cpp:
            (WebKit::isContextClick): New helper function - on Mac, not only right clicks
            but also control-left-clicks are context clicks.
            (WebKit::handleMouseEvent): Use above.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73675 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 148e502..1a17de9 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,16 @@
+2010-12-09  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by Brady Eidson.
+
+        WebKit2: Control-click doesn't invoke context menu
+        https://bugs.webkit.org/show_bug.cgi?id=50793
+        <rdar://problem/8664800>
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::isContextClick): New helper function - on Mac, not only right clicks
+        but also control-left-clicks are context clicks.
+        (WebKit::handleMouseEvent): Use above.
+
 2010-12-09  Anders Carlsson  <andersca at apple.com>
 
         Fix clang++ build.
diff --git a/WebKit2/WebProcess/WebPage/WebPage.cpp b/WebKit2/WebProcess/WebPage/WebPage.cpp
index e725466..59fdc63 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -627,6 +627,20 @@ private:
     const WebEvent* m_previousCurrentEvent;
 };
 
+static bool isContextClick(const PlatformMouseEvent& event)
+{
+    if (event.button() == WebCore::RightButton)
+        return true;
+
+#if PLATFORM(MAC)
+    // FIXME: this really should be about OSX-style UI, not about the Mac port
+    if (event.button() == WebCore::LeftButton && event.ctrlKey())
+        return true;
+#endif
+
+    return false;
+}
+
 static bool handleMouseEvent(const WebMouseEvent& mouseEvent, Page* page)
 {
     Frame* frame = page->mainFrame();
@@ -638,12 +652,12 @@ static bool handleMouseEvent(const WebMouseEvent& mouseEvent, Page* page)
     switch (platformMouseEvent.eventType()) {
         case WebCore::MouseEventPressed:
         {
-            if (platformMouseEvent.button() == WebCore::RightButton)
+            if (isContextClick(platformMouseEvent))
                 page->contextMenuController()->clearContextMenu();
             
             bool handled = frame->eventHandler()->handleMousePressEvent(platformMouseEvent);
             
-            if (platformMouseEvent.button() == WebCore::RightButton) {
+            if (isContextClick(platformMouseEvent)) {
                 handled = frame->eventHandler()->sendContextMenuEvent(platformMouseEvent);
                 if (handled)
                     page->chrome()->showContextMenu();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list