[gnome-shell/screenshot-ui-gsd-binds: 3/10] screenshot-ui: Add a screencast in progress property




commit b942d737ee87b14e4a8112782dee82328fdfe7e1
Author: Ivan Molodetskikh <yalterz gmail com>
Date:   Sat Nov 27 10:41:24 2021 +0300

    screenshot-ui: Add a screencast in progress property
    
    The screen recording menu entry will use this to check if a screencast
    is currently active and to stop the screencast.

 js/ui/screenshot.js | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
---
diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js
index 73b0c2c264..9e1f4e3189 100644
--- a/js/ui/screenshot.js
+++ b/js/ui/screenshot.js
@@ -1237,6 +1237,8 @@ class ScreenshotUI extends St.Widget {
         this._windowSelectors = [];
         this._rebuildMonitorBins();
 
+        this._screencastInProgress = false;
+
         Main.layoutManager.connect('monitors-changed', () => {
             // Nope, not dealing with monitor changes.
             this.close(true);
@@ -1822,6 +1824,19 @@ class ScreenshotUI extends St.Widget {
         }
     }
 
+    stopScreencast() {
+        if (!this._screencastInProgress)
+            return;
+
+        // Set this before calling the method as the screen recording indicator
+        // will check it before the success callback fires.
+        this._screencastInProgress = false;
+    }
+
+    get screencastInProgress() {
+        return this._screencastInProgress;
+    }
+
     vfunc_key_press_event(event) {
         const symbol = event.keyval;
         if (symbol === Clutter.KEY_Return || symbol === Clutter.KEY_space ||


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