diff options
author | Florian Müllner <fmuellner@gnome.org> | 2020-09-14 19:55:17 +0200 |
---|---|---|
committer | Florian Müllner <florian.muellner@gmail.com> | 2020-09-14 21:15:13 +0000 |
commit | 386d25e6f8ce11549526ea3776eb34138fcb3774 (patch) | |
tree | d36d3e2576b0ad09af6d477c13187a5c21b0bf4f /js | |
parent | b2d6c11ec39042855910f36d59e0789e16593fb9 (diff) | |
download | gnome-shell-386d25e6f8ce11549526ea3776eb34138fcb3774.tar.gz |
dbusServices/screencast: Add recordings to recent items
This is useful functionality that got lost when replacing the built-in
recorder with an external screencast service; bring it back.
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3171
Diffstat (limited to 'js')
-rw-r--r-- | js/dbusServices/screencast/screencastService.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/js/dbusServices/screencast/screencastService.js b/js/dbusServices/screencast/screencastService.js index dc38b44a1..e98089663 100644 --- a/js/dbusServices/screencast/screencastService.js +++ b/js/dbusServices/screencast/screencastService.js @@ -1,7 +1,9 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- /* exported ScreencastService */ -const { Gio, GLib, Gst } = imports.gi; +imports.gi.versions.Gtk = '3.0'; + +const { Gio, GLib, Gst, Gtk } = imports.gi; const { loadInterfaceXML, loadSubInterfaceXML } = imports.misc.fileUtils; const { ServiceImplementation } = imports.dbusService; @@ -78,6 +80,11 @@ var Recorder = class { this._drawCursor = options['draw-cursor']; } + _addRecentItem() { + const file = Gio.File.new_for_path(this._filePath); + Gtk.RecentManager.get_default().add_item(file.get_uri()); + } + _watchSender(sender) { this._nameWatchId = this._dbusConnection.watch_name( sender, @@ -180,6 +187,7 @@ var Recorder = class { switch (message.type) { case Gst.MessageType.EOS: this._pipeline.set_state(Gst.State.NULL); + this._addRecentItem(); switch (this._pipelineState) { case PipelineState.FLUSHING: @@ -238,6 +246,7 @@ var ScreencastService = class extends ServiceImplementation { super(ScreencastIface, '/org/gnome/Shell/Screencast'); Gst.init(null); + Gtk.init(null); this._recorders = new Map(); this._senders = new Map(); |