Update GTK clipboard handling

- Store the clipboard even if it was set in a GTK dialog.
- Fix a GtkTargetList leak.
- Notify GTK that the data is no longer available for
clipboard_get_cb(), so that GTK will no longer advertise nor attempt to
store the data.
This commit is contained in:
wolfbeast 2020-01-10 19:40:14 +01:00 committed by Roy Tam
commit 01ba6b6d82
2 changed files with 31 additions and 25 deletions

View file

@ -39,13 +39,12 @@ private:
static GdkAtom GetSelectionAtom (int32_t aWhichClipboard);
static GtkSelectionData *GetTargets (GdkAtom aWhichClipboard);
// Save global clipboard content to gtk
nsresult Store (void);
// Get our hands on the correct transferable, given a specific
// clipboard
nsITransferable *GetTransferable (int32_t aWhichClipboard);
void ClearTransferable(int32_t aWhichClipboard);
// Hang on to our owners and transferables so we can transfer data
// when asked.
nsCOMPtr<nsIClipboardOwner> mSelectionOwner;