[polari] Adapt to minor clipboard changes
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] Adapt to minor clipboard changes
- Date: Fri, 3 Sep 2021 11:17:32 +0000 (UTC)
commit 03ee8c668f35237fe4645e03e35e488e2097eef0
Author: Florian Müllner <fmuellner gnome org>
Date: Tue Aug 24 18:31:52 2021 +0200
Adapt to minor clipboard changes
Clipboard handling changed significantly in GTK4, and cannot easily
be emulated with GTK3 APIs. Some bits and pieces can though, so
adapt those.
Part-of: <https://gitlab.gnome.org/GNOME/polari/-/merge_requests/228>
src/chatView.js | 4 ++--
src/entryArea.js | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/chatView.js b/src/chatView.js
index cf995732..710dc53d 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -340,8 +340,8 @@ export default GObject.registerClass({
parameter_type: new GLib.VariantType('s'),
});
action.connect('activate', (a, params) => {
- const clipboard = Gtk.Clipboard.get_default(this.get_display());
- clipboard.set_text(params.unpack(), -1);
+ const clipboard = this.get_clipboard();
+ clipboard.set(params.unpack());
});
this._actionGroup.add_action(action);
diff --git a/src/entryArea.js b/src/entryArea.js
index 37bedb4e..b4e1e042 100644
--- a/src/entryArea.js
+++ b/src/entryArea.js
@@ -63,8 +63,8 @@ export const ChatEntry = GObject.registerClass({
return;
editable.stop_emission_by_name('paste-clipboard');
+ const clipboard = this.get_clipboard();
- let clipboard = Gtk.Clipboard.get_default(this.get_display());
clipboard.request_uris((cb, uris) => {
if (uris && uris.length)
this.emit('file-pasted', Gio.File.new_for_uri(uris[0]));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]