Changeset 54230 in webkit
- Timestamp:
- Feb 2, 2010 5:32:31 AM (14 years ago)
- Location:
- trunk/WebKit/gtk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/gtk/ChangeLog
r53967 r54230 1 2010-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 1 18 2010-01-27 Martin Robinson <mrobinson@webkit.org> 2 19 -
trunk/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp
r53477 r54230 106 106 } 107 107 108 static bool settingClipboard = false; 108 static DataObjectGtk* settingClipboardDataObject = 0; 109 static gpointer settingClipboardData = 0; 109 110 static void getClipboardContentsCallback(GtkClipboard* clipboard, GtkSelectionData *selectionData, guint info, gpointer data) 110 111 { … … 116 117 static void clearClipboardContentsCallback(GtkClipboard* clipboard, gpointer data) 117 118 { 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 123 119 DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard); 124 120 ASSERT(dataObject); 125 dataObject->clear();126 121 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) 129 129 return; 130 130 … … 155 155 156 156 if (numberOfTargets > 0 && table) { 157 settingClipboard = true; 157 settingClipboardDataObject = dataObject; 158 settingClipboardData = data; 158 159 159 160 // Protect the web view from being destroyed before one of the clipboard callbacks … … 169 170 g_object_unref(webView); 170 171 171 settingClipboard = false; 172 settingClipboardDataObject = 0; 173 settingClipboardData = 0; 172 174 } else 173 175 gtk_clipboard_clear(clipboard);
Note: See TracChangeset
for help on using the changeset viewer.