From 1b5d71130e3a48d8f636542f979346add7829544 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Thu, 8 Apr 2021 06:25:28 +0200 Subject: [PATCH] extensionsService: Fix copying technical details when extension crashes This was forgotten when porting to GTK 4, leading to the following error when user tries to copy the error message produced by an extension: JS ERROR: TypeError: Gtk.Clipboard is undefined _initActions/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:255:31 run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:177:20 main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13 run@resource:///org/gnome/gjs/modules/script/package.js:206:19 start@resource:///org/gnome/gjs/modules/script/package.js:190:8 @/nix/store/fwnkwvhwm3kqck4fhkc5y5z853radggg-gnome-shell-40.0/share/gnome-shell/.org.gnome.Shell.Extensions-wrapped:7:17 Part-of: --- js/dbusServices/extensions/extensionsService.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/dbusServices/extensions/extensionsService.js b/js/dbusServices/extensions/extensionsService.js index 35e780578..2a5cceaef 100644 --- a/js/dbusServices/extensions/extensionsService.js +++ b/js/dbusServices/extensions/extensionsService.js @@ -252,8 +252,8 @@ var ExtensionPrefsDialog = GObject.registerClass({ enabled: false, }); action.connect('activate', () => { - const clipboard = Gtk.Clipboard.get_default(this.get_display()); - clipboard.set_text(this._errorMarkdown, -1); + const clipboard = this.get_display().get_clipboard(); + clipboard.set_text(this._errorMarkdown); }); this._actionGroup.add_action(action);