Changeset 54230 in webkit


Ignore:
Timestamp:
Feb 2, 2010 5:32:31 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-02-02 Martin Robinson <martin.james.robinson@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.
Location:
trunk/WebKit/gtk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/gtk/ChangeLog

    r53967 r54230  
     12010-02-02  Martin Robinson  <martin.james.robinson@gmail.com>
     2
     3        Reviewed by Gustavo Noronha Silva.
     4
     5        [GTK] When selection changes selections in other WebView are not collapsed
     6        https://bugs.webkit.org/show_bug.cgi?id=34043
     7
     8        Collapse the selection of a WebView even when the new selection owner is
     9        a new WebView.
     10
     11        * WebCoreSupport/PasteboardHelperGtk.cpp:
     12        (WebKit::clearClipboardContentsCallback): Only clear the DataObject we are setting
     13        is not the same as the one referenced in this callback. Use the same behavior for
     14        collapsing the selection.
     15        (WebKit::PasteboardHelperGtk::writeClipboardContents): Instead of recording a boolean
     16        record the actual data used while writing to the clipboard.
     17
    1182010-01-27  Martin Robinson  <mrobinson@webkit.org>
    219
  • trunk/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp

    r53477 r54230  
    106106}
    107107
    108 static bool settingClipboard = false;
     108static DataObjectGtk* settingClipboardDataObject = 0;
     109static gpointer settingClipboardData = 0;
    109110static void getClipboardContentsCallback(GtkClipboard* clipboard, GtkSelectionData *selectionData, guint info, gpointer data)
    110111{
     
    116117static void clearClipboardContentsCallback(GtkClipboard* clipboard, gpointer data)
    117118{
    118     // GTK will call the clear clipboard callback while setting clipboard data.
    119     // We don't actually want to clear the DataObject during that time.
    120     if (settingClipboard)
    121         return;
    122 
    123119    DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard);
    124120    ASSERT(dataObject);
    125     dataObject->clear();
    126121
    127     // This will be true for clipboards other than X11 primary.
    128     if (!data)
     122    // Only clear the DataObject for this clipboard if we are not currently setting it.
     123    if (dataObject != settingClipboardDataObject)
     124        dataObject->clear();
     125
     126    // Only collapse the selection if this is an X11 primary clipboard
     127    // and we aren't currently setting the clipboard for this WebView.
     128    if (!data || data == settingClipboardData)
    129129        return;
    130130
     
    155155
    156156    if (numberOfTargets > 0 && table) {
    157         settingClipboard = true;
     157        settingClipboardDataObject = dataObject;
     158        settingClipboardData = data;
    158159
    159160        // Protect the web view from being destroyed before one of the clipboard callbacks
     
    169170            g_object_unref(webView);
    170171
    171         settingClipboard = false;
     172        settingClipboardDataObject = 0;
     173        settingClipboardData = 0;
    172174    } else
    173175        gtk_clipboard_clear(clipboard);
Note: See TracChangeset for help on using the changeset viewer.