[gnome-shell] status/remote-access: Add menu for stopping screencasts



commit 6d0c2ae69772981537613ab5bd7bd706e0445855
Author: Ivan Molodetskikh <yalterz gmail com>
Date:   Tue Aug 17 10:58:23 2021 +0300

    status/remote-access: Add menu for stopping screencasts
    
    This is specifically for stopping the screenshot UI screencasts for now.
    It's possible to stop arbitrary screen recording handles, however due to
    an issue with pipewiresrc, this method cannot currently work for cleanly
    stopping Shell's own screen recordings. Hence the best we can do is to
    handle just the screenshot UI screencasts to let them stop cleanly.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2103>

 js/ui/status/remoteAccess.js | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/js/ui/status/remoteAccess.js b/js/ui/status/remoteAccess.js
index 21f6581b61..d6d500caed 100644
--- a/js/ui/status/remoteAccess.js
+++ b/js/ui/status/remoteAccess.js
@@ -3,6 +3,7 @@
 
 const { GObject, Meta } = imports.gi;
 
+const Main = imports.ui.main;
 const PanelMenu = imports.ui.panelMenu;
 const PopupMenu = imports.ui.popupMenu;
 
@@ -50,6 +51,15 @@ class RemoteAccessApplet extends PanelMenu.SystemIndicator {
         this._recordingIndicator = this._addIndicator();
         this._recordingIndicator.icon_name = 'media-record-symbolic';
         this._recordingIndicator.add_style_class_name('screencast-indicator');
+
+        this._recordingItem = new PopupMenu.PopupSubMenuMenuItem(
+            _('Screen Recording in Progress'),
+            true
+        );
+        this._recordingItem.menu.addAction(_('Stop'),
+            () => Main.screenshotUI.stopScreencast());
+        this._recordingItem.icon.icon_name = 'media-record-symbolic';
+        this.menu.addMenuItem(this._recordingItem);
     }
 
     _isScreenShared() {
@@ -70,6 +80,7 @@ class RemoteAccessApplet extends PanelMenu.SystemIndicator {
         }
 
         this._recordingIndicator.visible = this._isRecording();
+        this._recordingItem.visible = Main.screenshotUI.screencast_in_progress;
     }
 
     _onStopped(handle) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]