[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

eric at webkit.org eric at webkit.org
Thu Feb 4 21:36:46 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 5ba95dafea9653030377865241e31d00179ead37
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Feb 2 13:32:31 2010 +0000

    2010-02-02  Martin Robinson  <martin.james.robinson at gmail.com>
    
            Reviewed by Gustavo Noronha Silva.
    
            [GTK] When selection changes selections in other WebView are not collapsed
            https://bugs.webkit.org/show_bug.cgi?id=34043
    
            Collapse the selection of a WebView even when the new selection owner is
            a new WebView.
    
            * WebCoreSupport/PasteboardHelperGtk.cpp:
            (WebKit::clearClipboardContentsCallback): Only clear the DataObject we are setting
            is not the same as the one referenced in this callback. Use the same behavior for
            collapsing the selection.
            (WebKit::PasteboardHelperGtk::writeClipboardContents): Instead of recording a boolean
            record the actual data used while writing to the clipboard.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54230 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index 3cd90de..ba3893c 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,20 @@
+2010-02-02  Martin Robinson  <martin.james.robinson at gmail.com>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        [GTK] When selection changes selections in other WebView are not collapsed
+        https://bugs.webkit.org/show_bug.cgi?id=34043
+
+        Collapse the selection of a WebView even when the new selection owner is
+        a new WebView.
+
+        * WebCoreSupport/PasteboardHelperGtk.cpp:
+        (WebKit::clearClipboardContentsCallback): Only clear the DataObject we are setting
+        is not the same as the one referenced in this callback. Use the same behavior for
+        collapsing the selection.
+        (WebKit::PasteboardHelperGtk::writeClipboardContents): Instead of recording a boolean
+        record the actual data used while writing to the clipboard.
+
 2010-01-27  Martin Robinson  <mrobinson at webkit.org>
 
         Reviewed by Gustavo Noronha Silva.
diff --git a/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp b/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp
index 8406ada..b8eb92d 100644
--- a/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp
@@ -105,7 +105,8 @@ static GtkTargetList* targetListForDataObject(DataObjectGtk* dataObject)
     return list;
 }
 
-static bool settingClipboard = false;
+static DataObjectGtk* settingClipboardDataObject = 0;
+static gpointer settingClipboardData = 0;
 static void getClipboardContentsCallback(GtkClipboard* clipboard, GtkSelectionData *selectionData, guint info, gpointer data)
 {
     DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard);
@@ -115,17 +116,16 @@ static void getClipboardContentsCallback(GtkClipboard* clipboard, GtkSelectionDa
 
 static void clearClipboardContentsCallback(GtkClipboard* clipboard, gpointer data)
 {
-    // GTK will call the clear clipboard callback while setting clipboard data.
-    // We don't actually want to clear the DataObject during that time.
-    if (settingClipboard)
-        return;
-
     DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard);
     ASSERT(dataObject);
-    dataObject->clear();
 
-    // This will be true for clipboards other than X11 primary.
-    if (!data)
+    // Only clear the DataObject for this clipboard if we are not currently setting it.
+    if (dataObject != settingClipboardDataObject)
+        dataObject->clear();
+
+    // Only collapse the selection if this is an X11 primary clipboard
+    // and we aren't currently setting the clipboard for this WebView.
+    if (!data || data == settingClipboardData)
         return;
 
     WebKitWebView* webView = reinterpret_cast<WebKitWebView*>(data);
@@ -154,7 +154,8 @@ void PasteboardHelperGtk::writeClipboardContents(GtkClipboard* clipboard, gpoint
     GtkTargetEntry* table = gtk_target_table_new_from_list(list, &numberOfTargets);
 
     if (numberOfTargets > 0 && table) {
-        settingClipboard = true;
+        settingClipboardDataObject = dataObject;
+        settingClipboardData = data;
 
         // Protect the web view from being destroyed before one of the clipboard callbacks
         // is called. Balanced in both getClipboardContentsCallback and
@@ -168,7 +169,8 @@ void PasteboardHelperGtk::writeClipboardContents(GtkClipboard* clipboard, gpoint
         if (!succeeded)
             g_object_unref(webView);
 
-        settingClipboard = false;
+        settingClipboardDataObject = 0;
+        settingClipboardData = 0;
     } else
         gtk_clipboard_clear(clipboard);
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list