зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
303818c484
Коммит
8a2f160728
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче