bug 1590965 call gtk_clipboard_store() from an event r=stransky

Differential Revision: https://phabricator.services.mozilla.com/D50538

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Karl Tomlinson 2019-10-29 21:47:25 +00:00
Родитель 303818c484
Коммит 8a2f160728
1 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -115,9 +115,14 @@ nsresult nsClipboard::Init(void) {
NS_IMETHODIMP
nsClipboard::Observe(nsISupports* aSubject, const char* aTopic,
const char16_t* aData) {
// Save global clipboard content to CLIPBOARD_MANAGER
gtk_clipboard_store(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD));
return NS_OK;
// Save global clipboard content to CLIPBOARD_MANAGER.
// gtk_clipboard_store() can run an event loop, so call from a dedicated
// runnable.
return SystemGroup::Dispatch(
TaskCategory::Other,
NS_NewRunnableFunction("gtk_clipboard_store()", []() {
gtk_clipboard_store(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD));
}));
}
NS_IMETHODIMP