[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

kov at webkit.org kov at webkit.org
Thu Oct 29 20:34:12 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 72f151bfc73971f84dc2154cd750726f8789c8c1
Author: kov at webkit.org <kov at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Sep 25 14:01:52 2009 +0000

    2009-09-25  Gustavo Noronha Silva  <gustavo.noronha at collabora.co.uk>
    
            Reviewed by Xan Lopez.
    
            Pop down the context menu when the page transitions to committed,
            to avoid keeping a context menu out of context.
    
            * WebCoreSupport/FrameLoaderClientGtk.cpp:
            (WebKit::FrameLoaderClient::transitionToCommittedForNewPage):
            * webkit/webkitprivate.h:
            * webkit/webkitwebview.cpp:
            (destroy_menu_cb):
            (webkit_web_view_forward_context_menu_event):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48753 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index d662e20..107bf03 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,17 @@
+2009-09-25  Gustavo Noronha Silva  <gustavo.noronha at collabora.co.uk>
+
+        Reviewed by Xan Lopez.
+
+        Pop down the context menu when the page transitions to committed,
+        to avoid keeping a context menu out of context.
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::transitionToCommittedForNewPage):
+        * webkit/webkitprivate.h:
+        * webkit/webkitwebview.cpp:
+        (destroy_menu_cb):
+        (webkit_web_view_forward_context_menu_event):
+
 2009-09-24  Jon Honeycutt  <jhoneycutt at apple.com>
 
         Reviewed by Alice Liu.
diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
index 29ee09e..6a86235 100644
--- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
@@ -1075,6 +1075,14 @@ void FrameLoaderClient::transitionToCommittedForNewPage()
 
     WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW_GET_PRIVATE(containingWindow);
     frame->view()->setGtkAdjustments(priv->horizontalAdjustment, priv->verticalAdjustment);
+
+    if (priv->currentMenu) {
+        GtkMenu* menu = priv->currentMenu;
+        priv->currentMenu = NULL;
+
+        gtk_menu_popdown(menu);
+        g_object_unref(menu);
+    }
 }
 
 }
diff --git a/WebKit/gtk/webkit/webkitprivate.h b/WebKit/gtk/webkit/webkitprivate.h
index cfb8207..07ff11d 100644
--- a/WebKit/gtk/webkit/webkitprivate.h
+++ b/WebKit/gtk/webkit/webkitprivate.h
@@ -121,6 +121,7 @@ extern "C" {
         WebKitWebFrame* mainFrame;
         WebKitWebBackForwardList* backForwardList;
 
+        GtkMenu* currentMenu;
         gint lastPopupXPosition;
         gint lastPopupYPosition;
 
diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp
index 988d01f..777000b 100644
--- a/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/WebKit/gtk/webkit/webkitwebview.cpp
@@ -180,6 +180,15 @@ G_DEFINE_TYPE(WebKitWebView, webkit_web_view, GTK_TYPE_CONTAINER)
 static void webkit_web_view_settings_notify(WebKitWebSettings* webSettings, GParamSpec* pspec, WebKitWebView* webView);
 static void webkit_web_view_set_window_features(WebKitWebView* webView, WebKitWebWindowFeatures* webWindowFeatures);
 
+static void destroy_menu_cb(GtkObject* object, gpointer data)
+{
+    WebKitWebView* webView = WEBKIT_WEB_VIEW(data);
+    WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
+
+    g_object_unref(priv->currentMenu);
+    priv->currentMenu = NULL;
+}
+
 static gboolean webkit_web_view_forward_context_menu_event(WebKitWebView* webView, const PlatformMouseEvent& event)
 {
     Page* page = core(webView);
@@ -211,8 +220,14 @@ static gboolean webkit_web_view_forward_context_menu_event(WebKitWebView* webVie
         return FALSE;
 
     WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
+    priv->currentMenu = GTK_MENU(g_object_ref(menu));
     priv->lastPopupXPosition = event.globalX();
     priv->lastPopupYPosition = event.globalY();
+
+    g_signal_connect(menu, "destroy",
+                     G_CALLBACK(destroy_menu_cb),
+                     NULL);
+
     gtk_menu_popup(menu, NULL, NULL,
                    NULL,
                    priv, event.button() + 1, gtk_get_current_event_time());

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list