[gnome-shell/screenshot-ui-gsd-binds: 4/10] status/remote-access: Add menu for stopping screencasts




commit 9bf642f738509c9858b17ae701f55000928093ca
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.

 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..a67062de48 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.screencastInProgress;
     }
 
     _onStopped(handle) {


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